chiark / gitweb /
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 66276aa54e3925aa6c21225bd39f71a6616de4ec..b5ffaa1c3ccc0f6bff8cc7e5bfdf728a019efa3d 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;
 }