[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / content / common / sandbox_linux / sandbox_bpf_base_policy_linux.cc
blobd1e5af305631a671f85c7e837a279c842ab151cf
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/common/sandbox_linux/sandbox_bpf_base_policy_linux.h"
7 #include <errno.h>
9 #include "base/logging.h"
10 #include "sandbox/linux/seccomp-bpf-helpers/baseline_policy.h"
12 namespace content {
14 namespace {
16 // The errno used for denied file system access system calls, such as open(2).
17 static const int kFSDeniedErrno = EPERM;
19 } // namespace.
21 SandboxBPFBasePolicy::SandboxBPFBasePolicy()
22 : baseline_policy_(new sandbox::BaselinePolicy(kFSDeniedErrno)) {}
23 SandboxBPFBasePolicy::~SandboxBPFBasePolicy() {}
25 ErrorCode SandboxBPFBasePolicy::EvaluateSyscall(SandboxBPF* sandbox_compiler,
26 int system_call_number) const {
27 DCHECK(baseline_policy_);
28 return baseline_policy_->EvaluateSyscall(sandbox_compiler,
29 system_call_number);
32 bool SandboxBPFBasePolicy::PreSandboxHook() {
33 return true;
36 int SandboxBPFBasePolicy::GetFSDeniedErrno() {
37 return kFSDeniedErrno;
40 } // namespace content.