7684fe62e48d — Duncan Ross Palmer tip 1 year, 1 month ago
Added vixie-cron-4.1-_46-clustering.patch
1 files changed, 167 insertions(+), 0 deletions(-)

A => debian/patches/vixie-cron-4.1-_46-clustering.patch
A => debian/patches/vixie-cron-4.1-_46-clustering.patch +167 -0
@@ 0,0 1,167 @@ 
+diff -urN vixie-cron-4.1/CONVERSION vixie-v-cron-2-palmer/CONVERSION
+--- vixie-cron-4.1/CONVERSION	2004-07-21 14:31:55.000000000 +0100
++++ vixie-v-cron-2-palmer/CONVERSION	2009-09-16 16:33:32.036516325 +0100
+@@ -24,7 +24,7 @@
+ 
+ I say `how about' and `perhaps' because it really doesn't matter to anyone
+ (except you) where you put the crontab source files.  The `crontab' command
+-COPIES them into a protected directory (CRONDIR/SPOOL_DIR in cron.h), named
++COPIES them into a protected directory (CRONDIR/SPOOL_DIR_EDITOR in cron.h), named
+ after the user whose crontab it is.  If you want to examine, replace, or
+ delete a crontab, the `crontab' command does all of those things.  The
+ various `crontab.src' (my suggested name for them) files are just source
+diff -urN vixie-cron-4.1/crontab.c vixie-v-cron-2-palmer/crontab.c
+--- vixie-cron-4.1/crontab.c	2009-09-16 16:26:08.880591079 +0100
++++ vixie-v-cron-2-palmer/crontab.c	2009-09-16 16:32:55.072712178 +0100
+@@ -279,7 +279,7 @@
+ 	int ch;
+ 
+ 	log_it(RealUser, Pid, "LIST", User);
+-	if (!glue_strings(n, sizeof n, SPOOL_DIR, User, '/')) {
++	if (!glue_strings(n, sizeof n, SPOOL_DIR_EDITOR, User, '/')) {
+ 		fprintf(stderr, "path too long\n");
+ 		exit(ERROR_EXIT);
+ 	}
+@@ -315,7 +315,7 @@
+ 	}
+ 
+ 	log_it(RealUser, Pid, "DELETE", User);
+-	if (!glue_strings(n, sizeof n, SPOOL_DIR, User, '/')) {
++	if (!glue_strings(n, sizeof n, SPOOL_DIR_EDITOR, User, '/')) {
+ 		fprintf(stderr, "path too long\n");
+ 		exit(ERROR_EXIT);
+ 	}
+@@ -350,7 +350,7 @@
+ 	PID_T pid, xpid;
+ 
+ 	log_it(RealUser, Pid, "BEGIN EDIT", User);
+-	if (!glue_strings(n, sizeof n, SPOOL_DIR, User, '/')) {
++	if (!glue_strings(n, sizeof n, SPOOL_DIR_EDITOR, User, '/')) {
+ 		fprintf(stderr, "path too long\n");
+ 		exit(ERROR_EXIT);
+ 	}
+@@ -607,7 +607,7 @@
+ 		return (-2);
+ 	}
+ 
+-	if (!glue_strings(TempFilename, sizeof TempFilename, SPOOL_DIR,
++	if (!glue_strings(TempFilename, sizeof TempFilename, SPOOL_DIR_EDITOR,
+ 	    "tmp.XXXXXXXXXX", '/')) {
+ 		TempFilename[0] = '\0';
+ 		fprintf(stderr, "path too long\n");
+@@ -713,7 +713,7 @@
+ 		goto done;
+ 	}
+ 
+-	if (!glue_strings(n, sizeof n, SPOOL_DIR, User, '/')) {
++	if (!glue_strings(n, sizeof n, SPOOL_DIR_EDITOR, User, '/')) {
+ 		fprintf(stderr, "path too long\n");
+ 		error = -2;
+ 		goto done;
+@@ -747,9 +747,9 @@
+ 
+ static void
+ poke_daemon(void) {
+-	if (utime(SPOOL_DIR, NULL) < OK) {
++	if (utime(SPOOL_DIR_EDITOR, NULL) < OK) {
+ 		fprintf(stderr, "crontab: can't update mtime on spooldir\n");
+-		perror(SPOOL_DIR);
++		perror(SPOOL_DIR_EDITOR);
+ 		return;
+ 	}
+ }
+diff -urN vixie-cron-4.1/database.c vixie-v-cron-2-palmer/database.c
+--- vixie-cron-4.1/database.c	2009-09-16 16:26:10.940543186 +0100
++++ vixie-v-cron-2-palmer/database.c	2009-09-16 16:39:07.316553246 +0100
+@@ -44,12 +44,12 @@
+ 
+ 	Debug(DLOAD, ("[%ld] load_database()\n", (long)getpid()))
+ 
+-	/* before we start loading any data, do a stat on SPOOL_DIR
++	/* before we start loading any data, do a stat on SPOOL_DIR_DAEMON
+ 	 * so that if anything changes as of this moment (i.e., before we've
+ 	 * cached any of the database), we'll see the changes next time.
+ 	 */
+-	if (stat(SPOOL_DIR, &statbuf) < OK) {
+-		log_it("CRON", getpid(), "STAT FAILED", SPOOL_DIR);
++	if (stat(SPOOL_DIR_DAEMON, &statbuf) < OK) {
++		log_it("CRON", getpid(), "STAT FAILED", SPOOL_DIR_DAEMON);
+ 		(void) exit(ERROR_EXIT);
+ 	}
+ 
+@@ -142,8 +142,8 @@
+ 	 * efficiency.  however, we need to close it in every fork, and
+ 	 * we fork a lot more often than the mtime of the dir changes.
+ 	 */
+-	if (!(dir = opendir(SPOOL_DIR))) {
+-		log_it("CRON", getpid(), "OPENDIR FAILED", SPOOL_DIR);
++	if (!(dir = opendir(SPOOL_DIR_DAEMON))) {
++		log_it("CRON", getpid(), "OPENDIR FAILED", SPOOL_DIR_DAEMON);
+ 		(void) exit(ERROR_EXIT);
+ 	}
+ 
+@@ -162,7 +162,7 @@
+ 			continue;	/* XXX log? */
+ 		(void) strcpy(fname, dp->d_name);
+ 		
+-		if (!glue_strings(tabname, sizeof tabname, SPOOL_DIR,
++		if (!glue_strings(tabname, sizeof tabname, SPOOL_DIR_DAEMON,
+ 				  fname, '/'))
+ 			continue;	/* XXX log? */
+ 
+diff -urN vixie-cron-4.1/misc.c vixie-v-cron-2-palmer/misc.c
+--- vixie-cron-4.1/misc.c	2009-09-16 16:25:42.460591052 +0100
++++ vixie-v-cron-2-palmer/misc.c	2009-09-16 16:36:40.332555194 +0100
+@@ -235,29 +235,29 @@
+ 		exit(ERROR_EXIT);
+ 	}
+ 
+-	/* CRONDIR okay (now==CWD), now look at SPOOL_DIR ("tabs" or some such)
++	/* CRONDIR okay (now==CWD), now look at SPOOL_DIR_EDITOR ("tabs" or some such)
+ 	 */
+-	if (stat(SPOOL_DIR, &sb) < OK && errno == ENOENT) {
+-		perror(SPOOL_DIR);
+-		if (OK == mkdir(SPOOL_DIR, 0700)) {
+-			fprintf(stderr, "%s: created\n", SPOOL_DIR);
+-			stat(SPOOL_DIR, &sb);
++	if (stat(SPOOL_DIR_EDITOR, &sb) < OK && errno == ENOENT) {
++		perror(SPOOL_DIR_EDITOR);
++		if (OK == mkdir(SPOOL_DIR_EDITOR, 0700)) {
++			fprintf(stderr, "%s: created\n", SPOOL_DIR_EDITOR);
++			stat(SPOOL_DIR_EDITOR, &sb);
+ 		} else {
+-			fprintf(stderr, "%s: ", SPOOL_DIR);
++			fprintf(stderr, "%s: ", SPOOL_DIR_EDITOR);
+ 			perror("mkdir");
+ 			exit(ERROR_EXIT);
+ 		}
+ 	}
+ 	if (!S_ISDIR(sb.st_mode)) {
+ 		fprintf(stderr, "'%s' is not a directory, bailing out.\n",
+-			SPOOL_DIR);
++			SPOOL_DIR_EDITOR);
+ 		exit(ERROR_EXIT);
+ 	}
+ 	if (grp != NULL) {
+ 		if (sb.st_gid != grp->gr_gid)
+-			chown(SPOOL_DIR, -1, grp->gr_gid);
++			chown(SPOOL_DIR_EDITOR, -1, grp->gr_gid);
+ 		if (sb.st_mode != 01730)
+-			chmod(SPOOL_DIR, 01730);
++			chmod(SPOOL_DIR_EDITOR, 01730);
+ 	}
+ }
+ 
+diff -urN vixie-cron-4.1/pathnames.h vixie-v-cron-2-palmer/pathnames.h
+--- vixie-cron-4.1/pathnames.h	2009-09-16 16:23:47.692886157 +0100
++++ vixie-v-cron-2-palmer/pathnames.h	2009-09-16 16:30:24.092799221 +0100
+@@ -46,7 +46,8 @@
+ 			 * newer than they were last time around (or which
+ 			 * didn't exist last time around...)
+ 			 */
+-#define SPOOL_DIR	"cron"
++#define SPOOL_DIR_DAEMON "cron"
++#define SPOOL_DIR_EDITOR "shared_cron"
+ 
+ 			/* cron allow/deny file.  At least cron.deny must
+ 			 * exist for ordinary users to run crontab.