aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-08-20 10:19:03 +0000
committerRoy Marples <roy@marples.name>2008-08-20 10:19:03 +0000
commitfabee4dc2dcd4960c9da2c820eda443ff9d3ef4f (patch)
tree8dc67d231b98def5593ad5ca6bad28e4dac02d43
parent1ab1e9328a6313ae7d77957168484ce4b52fdf5d (diff)
Actually set the umask.
-rw-r--r--src/rc/start-stop-daemon.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index dfecd609..d4904f4a 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -603,6 +603,7 @@ int start_stop_daemon(int argc, char **argv)
char line[130];
FILE *fp;
size_t len;
+ bool setumask = false;
mode_t numask;
TAILQ_INIT(&schedule);
@@ -703,6 +704,7 @@ 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 */
@@ -929,6 +931,8 @@ int start_stop_daemon(int argc, char **argv)
/* Child process - lets go! */
if (pid == 0) {
pid_t mypid = getpid();
+ if (setumask)
+ umask(numask);
#ifdef TIOCNOTTY
tty_fd = open("/dev/tty", O_RDWR);