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

Unified Diff: sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.cc

Issue 733303004: Linux sandbox: change API to start the sandbox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits from Jorge. Created 6 years, 1 month 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/seccomp-bpf/sandbox_bpf.cc ('k') | sandbox/linux/services/thread_helpers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.cc
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.cc
index 59ee26f6ed417f419726decfea604103f0b0844d..cfdb69f5a6b1148c5e5a87480026b418577c5b5c 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.cc
@@ -31,17 +31,10 @@ void SandboxBPFTestRunner::Run() {
scoped_ptr<bpf_dsl::Policy> policy =
bpf_tester_delegate_->GetSandboxBPFPolicy();
- if (sandbox::SandboxBPF::SupportsSeccompSandbox(-1) ==
+ if (sandbox::SandboxBPF::SupportsSeccompSandbox() ==
sandbox::SandboxBPF::STATUS_AVAILABLE) {
- // Ensure the the sandbox is actually available at this time
- int proc_fd;
- SANDBOX_ASSERT((proc_fd = open("/proc", O_RDONLY | O_DIRECTORY)) >= 0);
- SANDBOX_ASSERT(sandbox::SandboxBPF::SupportsSeccompSandbox(proc_fd) ==
- sandbox::SandboxBPF::STATUS_AVAILABLE);
-
// Initialize and then start the sandbox with our custom policy
sandbox::SandboxBPF sandbox;
- sandbox.set_proc_fd(proc_fd);
sandbox.SetSandboxPolicy(policy.release());
SANDBOX_ASSERT(
sandbox.StartSandbox(sandbox::SandboxBPF::PROCESS_SINGLE_THREADED));
« no previous file with comments | « sandbox/linux/seccomp-bpf/sandbox_bpf.cc ('k') | sandbox/linux/services/thread_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698