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

Unified Diff: content/zygote/zygote_linux.cc

Issue 13814027: Linux: make current InitializeSandbox() private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
« content/common/sandbox_linux.h ('K') | « content/worker/worker_main.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_linux.cc
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index b546e15b2df45ee6e460e81889a0f705aeb783f8..2be587cb390cd5df7ad08136ecf8f965096e8259 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -24,6 +24,7 @@
#include "content/common/set_process_title.h"
#include "content/common/zygote_commands_linux.h"
#include "content/public/common/content_descriptors.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
#include "content/public/common/sandbox_linux.h"
#include "content/public/common/zygote_fork_delegate_linux.h"
@@ -435,7 +436,16 @@ base::ProcessId Zygote::ReadArgsAndFork(const Pickle& pickle,
// This is the child process.
// At this point, we finally know our process type.
- LinuxSandbox::GetInstance()->PreinitializeSandboxFinish(process_type);
+ if (process_type == switches::kRendererProcess) {
+ // The seccomp-legacy sandbox requires special handling and is only
+ // ever enabled for renderers. TODO(jln): remove the seccomp-legacy
+ // sandbox.
+ LinuxSandbox::GetInstance()->PreinitializeSandboxFinish(
+ LinuxSandbox::SANDBOX_CONFIG_RENDERER);
+ } else {
+ LinuxSandbox::GetInstance()->PreinitializeSandboxFinish(
+ LinuxSandbox::SANDBOX_CONFIG_GENERIC);
+ }
close(kBrowserDescriptor); // Our socket from the browser.
if (UsingSUIDSandbox())
« content/common/sandbox_linux.h ('K') | « content/worker/worker_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698