diff -uNrb monit-2.5.orig/monitor.c monit-2.5/monitor.c --- monit-2.5.orig/monitor.c Thu Jul 11 09:34:34 2002 +++ monit-2.5/monitor.c Wed Aug 7 15:40:53 2002 @@ -114,6 +114,12 @@ signal(SIGPIPE, SIG_IGN); /* + * Save the umask so that we can restore it later. + */ + Run.umask = umask(0); + (void) umask(Run.umask); + + /* * Initialize the Runtime mutex. This mutex * is used to synchronize handling of global * process data diff -uNrb monit-2.5.orig/monitor.h.in monit-2.5/monitor.h.in --- monit-2.5.orig/monitor.h.in Fri Jul 12 05:08:42 2002 +++ monit-2.5/monitor.h.in Wed Aug 7 15:07:00 2002 @@ -108,7 +108,7 @@ } MailFormat; pthread_mutex_t mutex; /**< Mutex used for process data synchronization */ - + mode_t umask; /**< Initial umask */ }; /** Defines a port object */ diff -uNrb monit-2.5.orig/spawn.c monit-2.5/spawn.c --- monit-2.5.orig/spawn.c Thu Jul 11 00:37:37 2002 +++ monit-2.5/spawn.c Wed Aug 7 15:43:23 2002 @@ -127,6 +127,11 @@ */ fd_to_wonderland(); + /* + * Restore umask just before exec. + */ + (void) umask(Run.umask); + /* Garbage collect */ do_free();