diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-13 14:17:28 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-13 14:17:28 +0000 |
commit | 715b4f26c39acb45471ce5c86238c12d0d3ec815 (patch) | |
tree | 9325d73f1cdf7a732fcfbddf2aab688cbf326135 /sandbox | |
parent | 12a32ce36874cef26bd5e8b0b64e8a0961b36db2 (diff) | |
download | chromium_src-715b4f26c39acb45471ce5c86238c12d0d3ec815.zip chromium_src-715b4f26c39acb45471ce5c86238c12d0d3ec815.tar.gz chromium_src-715b4f26c39acb45471ce5c86238c12d0d3ec815.tar.bz2 |
Add about:sandbox.
(Idea from Julien Tinnes)
BUG=none
TEST=Navigate to about:sandbox on Linux and see the status of the sandbox.
http://codereview.chromium.org/2966003/show
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52176 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox')
-rw-r--r-- | sandbox/linux/suid/sandbox.c | 15 |
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"); |