File vixie-cron-4.1-stat-no-fstat.diff of Package cron
--- vixie-cron-4.1/crontab.c
+++ vixie-cron-4.1/crontab.c
@@ -458,7 +458,7 @@
(void)signal(SIGHUP, SIG_DFL);
(void)signal(SIGINT, SIG_DFL);
(void)signal(SIGQUIT, SIG_DFL);
- if (fstat(t, &statbuf) < 0) {
+ if (stat(Filename, &statbuf) < 0) {
perror("fstat");
goto fatal;
}
@@ -468,6 +468,13 @@
goto remove;
}
fprintf(stderr, "%s: installing new crontab\n", ProgramName);
+ fclose(NewCrontab);
+ NewCrontab=fopen(Filename,"r+");
+ if( NewCrontab == 0L )
+ {
+ perror("fopen");
+ goto fatal;
+ }
switch (replace_cmd()) {
case 0:
break;