Fix: Missing umask when using run as no clone
[lttng-tools.git] / 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.022927 seconds and 4 git commands to generate.