diff -urp vixie-cron-4.1/database.c vixie-cron-4.1.fixed/database.c --- vixie-cron-4.1/database.c 2009-08-14 09:34:25.000000000 +0200 +++ vixie-cron-4.1.fixed/database.c 2009-08-14 09:44:56.000000000 +0200 @@ -53,8 +53,8 @@ load_database(cron_db *old_db) { (void) exit(ERROR_EXIT); } - if (stat("/etc/cron.d", &crond_stat) < OK) { - log_it("CRON", getpid(), "STAT FAILED", SPOOL_DIR); + if (stat(CRON_D_DIR, &crond_stat) < OK) { + log_it("CRON", getpid(), "STAT FAILED", CRON_D_DIR); (void) exit(ERROR_EXIT); } @@ -97,7 +97,7 @@ load_database(cron_db *old_db) { while (NULL != (dp = readdir(dir))) { char fname[MAXNAMLEN+1], - tabname[MAXNAMLEN+1]; + tabname[PATH_MAX+1]; /* avoid file names beginning with ".". this is good * because we would otherwise waste two guaranteed calls @@ -113,7 +113,7 @@ load_database(cron_db *old_db) { (void) strncpy(fname, dp->d_name, MAXNAMLEN); snprintf(tabname, MAXNAMLEN+1, "/etc/cron.d/%s", fname); - process_crontab("root", NULL, tabname, + process_crontab("root", tabname, tabname, &crond_stat, &new_db, old_db); } closedir(dir); diff -urp vixie-cron-4.1/pathnames.h vixie-cron-4.1.fixed/pathnames.h --- vixie-cron-4.1/pathnames.h 2009-08-14 09:34:25.000000000 +0200 +++ vixie-cron-4.1.fixed/pathnames.h 2009-08-13 14:42:15.000000000 +0200 @@ -48,6 +48,13 @@ */ #define SPOOL_DIR "crontabs" + /* + * CRON_D_DIR is a directory with files parsed like + * crontab. Whenever one of it's files changes it gets + * reloaded. + */ +#define CRON_D_DIR "/etc/cron.d" + /* cron allow/deny file. At least cron.deny must * exist for ordinary users to run crontab. */