Fix: Missing umask when using run as no clone
authorDavid Goulet <dgoulet@efficios.com>
Mon, 10 Dec 2012 18:45:45 +0000 (13:45 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 10 Dec 2012 18:47:39 +0000 (13:47 -0500)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/runas.c

index cb697feee797a0baf36a4e70e008f2e33cb3f787..5bd43e65b7c072b5ea40e1f6e16807f594986fe4 100644 (file)
@@ -313,7 +313,14 @@ end:
 static
 int run_as_noclone(int (*cmd)(void *data), void *data, uid_t uid, gid_t gid)
 {
-       return cmd(data);
+       int ret;
+       mode_t old_mask;
+
+       old_mask = umask(0);
+       ret = cmd(data);
+       umask(old_mask);
+
+       return ret;
 }
 
 static
This page took 0.025893 seconds and 4 git commands to generate.