summaryrefslogtreecommitdiffstats
path: root/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/linux/suid/sandbox.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sandbox/linux/suid/sandbox.c b/sandbox/linux/suid/sandbox.c
index be6176a..0c92ad2 100644
--- a/sandbox/linux/suid/sandbox.c
+++ b/sandbox/linux/suid/sandbox.c
@@ -282,8 +282,21 @@ static bool MoveToNewNamespaces() {
if (pid > 0)
_exit(0);
- if (pid == 0)
+ if (pid == 0) {
+ if (kCloneExtraFlags[i] & CLONE_NEWPID) {
+ setenv("SBX_PID_NS", "", 1 /* overwrite */);
+ } else {
+ unsetenv("SBX_PID_NS");
+ }
+
+ if (kCloneExtraFlags[i] & CLONE_NEWPID) {
+ setenv("SBX_NET_NS", "", 1 /* overwrite */);
+ } else {
+ unsetenv("SBX_NET_NS");
+ }
+
break;
+ }
if (errno != EINVAL) {
perror("Failed to move to new PID namespace");