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

Unified Diff: sandbox/linux/services/namespace_sandbox.cc

Issue 897723005: Allow using the namespace sandbox in zygote host. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More comments 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 | « sandbox/linux/services/namespace_sandbox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/services/namespace_sandbox.cc
diff --git a/sandbox/linux/services/namespace_sandbox.cc b/sandbox/linux/services/namespace_sandbox.cc
index 559b93c7e6e19621fdf8e363fddb2ab69f1f42bd..d5856882e35707589916321cd789bdd6108f0131 100644
--- a/sandbox/linux/services/namespace_sandbox.cc
+++ b/sandbox/linux/services/namespace_sandbox.cc
@@ -11,6 +11,7 @@
#include <string>
#include <utility>
+#include <vector>
#include "base/command_line.h"
#include "base/environment.h"
@@ -59,6 +60,13 @@ const char kSandboxNETNSEnvironmentVarName[] = "SBX_NET_NS";
base::Process NamespaceSandbox::LaunchProcess(
const base::CommandLine& cmdline,
const base::LaunchOptions& options) {
+ return LaunchProcess(cmdline.argv(), options);
+}
+
+// static
+base::Process NamespaceSandbox::LaunchProcess(
+ const std::vector<std::string>& argv,
+ const base::LaunchOptions& options) {
int clone_flags = 0;
int ns_types[] = {CLONE_NEWUSER, CLONE_NEWPID, CLONE_NEWNET};
for (const int ns_type : ns_types) {
@@ -91,7 +99,7 @@ base::Process NamespaceSandbox::LaunchProcess(
SetEnvironForNamespaceType(environ, environ_name, clone_flags & flag);
}
- return base::LaunchProcess(cmdline, launch_options);
+ return base::LaunchProcess(argv, launch_options);
}
// static
« no previous file with comments | « sandbox/linux/services/namespace_sandbox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698