SOURCES: vixie-cron-CAN-2005-1038.patch - now this patch contains ...

hawk hawk at pld-linux.org
Fri Sep 2 13:03:30 CEST 2005


Author: hawk                         Date: Fri Sep  2 11:03:30 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- now this patch contains 3 patches from Fedora merged together
  (crontab_stat_not_fstat.patch, CAN-2005-1038.patch and
  CAN-2005-1038-fix-race.patch)

---- Files affected:
SOURCES:
   vixie-cron-CAN-2005-1038.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/vixie-cron-CAN-2005-1038.patch
diff -u SOURCES/vixie-cron-CAN-2005-1038.patch:1.1 SOURCES/vixie-cron-CAN-2005-1038.patch:1.2
--- SOURCES/vixie-cron-CAN-2005-1038.patch:1.1	Tue Aug  2 14:12:53 2005
+++ SOURCES/vixie-cron-CAN-2005-1038.patch	Fri Sep  2 13:03:25 2005
@@ -1,24 +1,52 @@
---- vixie-cron-4.1/crontab.c.CAN-2005-1038	2005-04-14 18:39:04.356618000 -0400
-+++ vixie-cron-4.1/crontab.c	2005-04-14 18:43:50.262425000 -0400
-@@ -497,6 +497,21 @@
- 			ProgramName);
- 		goto remove;
+diff -u vixie.orig/crontab.c vixie/crontab.c
+--- vixie.orig/crontab.c	2005-09-02 09:37:24.000000000 +0200
++++ vixie/crontab.c	2005-09-02 12:23:06.000000000 +0200
+@@ -471,17 +471,45 @@
+ 	}
+ 	(void)signal(SIGHUP, SIG_DFL);
+ 	(void)signal(SIGINT, SIG_DFL);
+-	(void)signal(SIGQUIT, SIG_DFL);
+-	if (fstat(t, &statbuf) < 0) {
+-		perror("fstat");
++	(void)signal(SIGQUIT, SIG_DFL);      
++
++	if (lstat(Filename, &statbuf) < 0) {
++		perror("lstat");
+ 		goto fatal;
  	}
 +
-+	if (  (!S_ISREG(statbuf.st_mode))
-+	    ||(S_ISLNK(statbuf.st_mode))
-+	    ||(S_ISDIR(statbuf.st_mode))
-+            ||(S_ISCHR(statbuf.st_mode))
-+	    ||(S_ISBLK(statbuf.st_mode))
-+            ||(S_ISFIFO(statbuf.st_mode))
-+	    ||(S_ISSOCK(statbuf.st_mode))
-+	    )
++	if ( !S_ISREG(statbuf.st_mode) )
 +	{
 +	    fprintf(stderr, "%s: illegal crontab\n",
 +			ProgramName);
 +		goto remove;	    
 +	}
 +
+ 	if (utimebuf.modtime == statbuf.st_mtime) {
+ 		fprintf(stderr, "%s: no changes made to crontab\n",
+ 			ProgramName);
+ 		goto remove;
+ 	}
++
  	fprintf(stderr, "%s: installing new crontab\n", ProgramName);
-         fclose(NewCrontab);
- 	NewCrontab=fopen(Filename,"r+");
++	fclose(NewCrontab);
++	if (swap_uids() < OK) {
++	    perror("swapping uids");
++	    goto remove;
++	}
++	if (!(NewCrontab = fopen(Filename, "r+"))) {
++	    perror("cannot read new crontab");
++	    goto remove;	    
++	}
++	if (swap_uids_back() < OK) {
++	    perror("swapping uids back");
++	    exit(ERROR_EXIT);
++	}
++	if( NewCrontab == 0L )
++	{
++	    perror("fopen");
++	    goto fatal;
++	}
+ 	switch (replace_cmd()) {
+ 	case 0:
+ 		break;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/vixie-cron-CAN-2005-1038.patch?r1=1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list