From: David Goulet Date: Mon, 10 Dec 2012 18:45:45 +0000 (-0500) Subject: Fix: Missing umask when using run as no clone X-Git-Tag: v2.1.0~70 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=5b73926fb372c1b1f6d426b566bfb682f4a058b0;ds=sidebyside Fix: Missing umask when using run as no clone Signed-off-by: David Goulet --- diff --git a/src/common/runas.c b/src/common/runas.c index cb697feee..5bd43e65b 100644 --- a/src/common/runas.c +++ b/src/common/runas.c @@ -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