From 5e2b3214aa6e9bb3559552d2218ce2eda312c1fc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 14 Dec 2013 05:04:49 +0100 Subject: util: when joining a namespace make sure to reset all uids to 0 after the transition --- src/shared/util.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/shared/util.c') diff --git a/src/shared/util.c b/src/shared/util.c index 66276aa54e..b5ffaa1c3c 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -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; } -- cgit v1.2.3-54-g00ecf