summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-14 05:04:49 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-14 05:10:25 +0100
commit5e2b3214aa6e9bb3559552d2218ce2eda312c1fc (patch)
tree16d86ad36d57dd9028d2cf23220172ee85089474 /src/shared/util.c
parentbc9fd78c7bfc39881e19457e476393635f8b0442 (diff)
util: when joining a namespace make sure to reset all uids to 0 after
the transition
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c6
1 files changed, 6 insertions, 0 deletions
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;
}