From: Lennart Poettering Date: Wed, 15 Feb 2012 03:56:59 +0000 (+0100) Subject: namespace: temporaily reset umask when creating private /tmp X-Git-Tag: v43~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21d279cf543c82705a5b3362818805603d2ab9f2;p=systemd namespace: temporaily reset umask when creating private /tmp --- diff --git a/src/namespace.c b/src/namespace.c index a06cac10..09bc8290 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; }