Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(941)

Unified Diff: content/zygote/zygote_main_linux.cc

Issue 940603003: Linux Sandbox: always discover Zygote PID properly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/zygote/zygote_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/zygote/zygote_main_linux.cc
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
index f43c299f8f8944713b7ba69d53f5cb283628cbd8..efbfdb02d87eb2a37b477fca668b0405fbcf148d 100644
--- a/content/zygote/zygote_main_linux.cc
+++ b/content/zygote/zygote_main_linux.cc
@@ -533,10 +533,14 @@ bool ZygoteMain(const MainFunctionParams& params,
linux_sandbox->setuid_sandbox_client()->IsSuidSandboxChild();
const bool using_namespace_sandbox =
sandbox::NamespaceSandbox::InNewUserNamespace();
+ const bool using_layer1_sandbox =
+ using_setuid_sandbox || using_namespace_sandbox;
if (using_setuid_sandbox) {
linux_sandbox->setuid_sandbox_client()->CloseDummyFile();
+ }
+ if (using_layer1_sandbox) {
// Let the ZygoteHost know we're booting up.
CHECK(UnixDomainSocket::SendMsg(kZygoteSocketPairFd,
kZygoteBootMessage,
@@ -546,8 +550,6 @@ bool ZygoteMain(const MainFunctionParams& params,
VLOG(1) << "ZygoteMain: initializing " << fork_delegates.size()
<< " fork delegates";
- const bool using_layer1_sandbox =
- using_setuid_sandbox || using_namespace_sandbox;
for (ZygoteForkDelegate* fork_delegate : fork_delegates) {
fork_delegate->Init(GetSandboxFD(), using_layer1_sandbox);
}
« no previous file with comments | « content/zygote/zygote_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698