chiark / gitweb /
nspawn: reset umask if needed
authorLennart Poettering <lennart@poettering.net>
Mon, 14 Mar 2011 02:28:00 +0000 (03:28 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 14 Mar 2011 02:28:00 +0000 (03:28 +0100)
src/nspawn.c

index bf4e6de..82b0ce4 100644 (file)
@@ -176,6 +176,9 @@ static int copy_devnodes(const char *dest) {
         int r = 0, k;
         char *tty = NULL;
         dev_t tty_devnum;
+        mode_t u;
+
+        u = umask(0000);
 
         NULSTR_FOREACH(d, devnodes) {
                 char *from = NULL, *to = NULL;
@@ -265,6 +268,8 @@ static int copy_devnodes(const char *dest) {
 
         free(tty);
 
+        umask(u);
+
         return r;
 }