From: Lennart Poettering Date: Sat, 14 Dec 2013 04:04:49 +0000 (+0100) Subject: util: when joining a namespace make sure to reset all uids to 0 after X-Git-Tag: v209~932 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=sidebyside;h=5e2b3214aa6e9bb3559552d2218ce2eda312c1fc;p=elogind.git util: when joining a namespace make sure to reset all uids to 0 after the transition --- diff --git a/src/shared/util.c b/src/shared/util.c index 66276aa54..b5ffaa1c3 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; }