]> err.no Git - systemd/commitdiff
namespace: temporaily reset umask when creating private /tmp
authorLennart Poettering <lennart@poettering.net>
Wed, 15 Feb 2012 03:56:59 +0000 (04:56 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 15 Feb 2012 04:00:54 +0000 (05:00 +0100)
src/namespace.c

index a06cac10fda45708e020148a39034d73e2d7e7bc..09bc82909f0f4d246b758b3606a6bb199735b983 100644 (file)
@@ -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;
         }