summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-02-15 04:56:59 +0100
committerLennart Poettering <lennart@poettering.net>2012-02-15 05:00:54 +0100
commit21d279cf543c82705a5b3362818805603d2ab9f2 (patch)
treefdf35e7864cd3f92bb0e3d0944e2ddbf53744707
parentfc8af9ff3fbbbf21bf26f21d2eb100f26afc201a (diff)
namespace: temporaily reset umask when creating private /tmp
-rw-r--r--src/namespace.c8
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;
}