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

Side by Side Diff: content/common/sandbox_seccomp_bpf_linux.cc

Issue 17834012: Linux Sandbox: fix external StartSandbox API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <asm/unistd.h> 5 #include <asm/unistd.h>
6 #include <dlfcn.h> 6 #include <dlfcn.h>
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/audit.h> 9 #include <linux/audit.h>
10 #include <linux/filter.h> 10 #include <linux/filter.h>
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after
1941 CHECK(started_sandbox); 1941 CHECK(started_sandbox);
1942 return true; 1942 return true;
1943 } 1943 }
1944 #endif 1944 #endif
1945 return false; 1945 return false;
1946 } 1946 }
1947 1947
1948 bool SandboxSeccompBpf::StartSandboxWithExternalPolicy( 1948 bool SandboxSeccompBpf::StartSandboxWithExternalPolicy(
1949 playground2::BpfSandboxPolicy policy) { 1949 playground2::BpfSandboxPolicy policy) {
1950 #if defined(SECCOMP_BPF_SANDBOX) 1950 #if defined(SECCOMP_BPF_SANDBOX)
1951 if (IsSeccompBpfDesired()) { 1951 if (IsSeccompBpfDesired() && SupportsSandbox()) {
1952 CHECK(policy); 1952 CHECK(policy);
1953 StartSandboxWithPolicy(policy, NULL); 1953 StartSandboxWithPolicy(policy, NULL);
1954 return true; 1954 return true;
1955 } 1955 }
1956 #endif // defined(SECCOMP_BPF_SANDBOX) 1956 #endif // defined(SECCOMP_BPF_SANDBOX)
1957 return false; 1957 return false;
1958 } 1958 }
1959 1959
1960 #if defined(SECCOMP_BPF_SANDBOX) 1960 #if defined(SECCOMP_BPF_SANDBOX)
1961 playground2::BpfSandboxPolicyCallback SandboxSeccompBpf::GetBaselinePolicy() { 1961 playground2::BpfSandboxPolicyCallback SandboxSeccompBpf::GetBaselinePolicy() {
1962 return base::Bind(&BaselinePolicyWithAux); 1962 return base::Bind(&BaselinePolicyWithAux);
1963 } 1963 }
1964 #endif // defined(SECCOMP_BPF_SANDBOX) 1964 #endif // defined(SECCOMP_BPF_SANDBOX)
1965 1965
1966 } // namespace content 1966 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698