From 069590d97f0db855022cb0a6fa2cee8e410bdccd Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 10 Feb 2009 23:11:17 +0000 Subject: Fix unmask option, thanks to douglas@openplans.org, #146 --- src/rc/start-stop-daemon.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index eb7490be..53de7bd2 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -653,8 +653,7 @@ int start_stop_daemon(int argc, char **argv) char line[130]; FILE *fp; size_t len; - bool setumask = false; - mode_t numask; + mode_t numask = 022; char **margv; unsigned int start_wait = 0; @@ -775,7 +774,6 @@ int start_stop_daemon(int argc, char **argv) if (parse_mode(&numask, optarg)) eerrorx("%s: invalid mode `%s'", applet, optarg); - setumask = true; break; case 'm': /* --make-pidfile */ @@ -1041,8 +1039,7 @@ int start_stop_daemon(int argc, char **argv) /* Child process - lets go! */ if (pid == 0) { pid_t mypid = getpid(); - if (setumask) - umask(numask); + umask(numask); #ifdef TIOCNOTTY tty_fd = open("/dev/tty", O_RDWR); @@ -1161,8 +1158,6 @@ int start_stop_daemon(int argc, char **argv) setenv("PATH", newpath, 1); } - umask(022); - stdout_fd = devnull_fd; stderr_fd = devnull_fd; if (redirect_stdout) { -- cgit v1.2.3