diff -urN vixie-cron-3.0.1.orig/cron.c vixie-cron-3.0.1/cron.c --- vixie-cron-3.0.1.orig/cron.c 2003-11-07 11:33:38.000000000 -0600 +++ vixie-cron-3.0.1/cron.c 2003-11-12 12:37:42.000000000 -0600 @@ -25,6 +25,8 @@ #include "cron.h" #include +#include +#include #if SYS_TIME_H # include # include @@ -58,6 +60,7 @@ char *argv[]; { cron_db database; + int i; ProgramName = argv[0]; @@ -108,6 +111,16 @@ } } + /* close stdin, stdout, and stderr */ + if ( (i = open("/dev/null", O_RDWR)) < 0) { + log_it("CRON",getpid(),"DEATH","can't open /dev/null"); + exit(0); + } + close(0); dup2(i, 0); + close(1); dup2(i, 1); + close(2); dup2(i, 2); + close(i); + acquire_daemonlock(0); database.head = NULL; database.tail = NULL;