util: when joining a namespace make sure to reset all uids to 0 after
authorLennart Poettering <lennart@poettering.net>
Sat, 14 Dec 2013 04:04:49 +0000 (05:04 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 14 Dec 2013 04:10:25 +0000 (05:10 +0100)
the transition

src/shared/util.c

index 66276aa..b5ffaa1 100644 (file)
@@ -6022,5 +6022,11 @@ int namespace_enter(int namespace_fd, int root_fd) {
         if (chroot(".") < 0)
                 return -errno;
 
+        if (setresgid(0, 0, 0) < 0)
+                return -errno;
+
+        if (setresuid(0, 0, 0) < 0)
+                return -errno;
+
         return 0;
 }