diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-02-15 04:56:59 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-02-15 05:00:54 +0100 |
commit | 21d279cf543c82705a5b3362818805603d2ab9f2 (patch) | |
tree | fdf35e7864cd3f92bb0e3d0944e2ddbf53744707 /src/namespace.c | |
parent | fc8af9ff3fbbbf21bf26f21d2eb100f26afc201a (diff) |
namespace: temporaily reset umask when creating private /tmp
Diffstat (limited to 'src/namespace.c')
-rw-r--r-- | src/namespace.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/namespace.c b/src/namespace.c index a06cac10fd..09bc82909f 100644 --- a/src/namespace.c +++ b/src/namespace.c @@ -253,11 +253,19 @@ int setup_namespace( } if (need_private) { + mode_t u; + memcpy(private_dir, tmp_dir, sizeof(tmp_dir)-1); + + u = umask(0000); if (mkdir(private_dir, 0777 + S_ISVTX) < 0) { + umask(u); + r = -errno; goto fail; } + + umask(u); remove_private = true; } |