
Originally the sandbox policies lived in //content, but with servicification this would create unwanted dependencies between //services and //content. Instead, create a new //sandbox/policy library to hold the sandbox integration code. This library can depend on the low-level //sandbox routines, but not nice versa. Tbr: ajgo@chromium.org (mechanical change rule) Bug: 1097376 Change-Id: I1ca9ac0015a625197f2d3aae104e8f7aa78dcfd9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2272609 Commit-Queue: Robert Sesek <rsesek@chromium.org> Reviewed-by: Ken Rockot <rockot@google.com> Reviewed-by: Alex Gough <ajgo@chromium.org> Cr-Commit-Position: refs/heads/master@{#786385}
30 lines
925 B
C++
30 lines
925 B
C++
// Copyright 2013 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "content/public/common/sandbox_init.h"
|
|
|
|
#include <memory>
|
|
#include <utility>
|
|
|
|
#include "base/files/scoped_file.h"
|
|
#include "build/build_config.h"
|
|
#include "sandbox/linux/bpf_dsl/policy.h"
|
|
#include "sandbox/policy/linux/sandbox_seccomp_bpf_linux.h"
|
|
|
|
namespace content {
|
|
|
|
bool InitializeSandbox(std::unique_ptr<sandbox::bpf_dsl::Policy> policy,
|
|
base::ScopedFD proc_fd) {
|
|
return sandbox::policy::SandboxSeccompBPF::StartSandboxWithExternalPolicy(
|
|
std::move(policy), std::move(proc_fd));
|
|
}
|
|
|
|
#if !defined(OS_NACL_NONSFI)
|
|
std::unique_ptr<sandbox::bpf_dsl::Policy> GetBPFSandboxBaselinePolicy() {
|
|
return sandbox::policy::SandboxSeccompBPF::GetBaselinePolicy();
|
|
}
|
|
#endif // !defined(OS_NACL_NONSFI)
|
|
|
|
} // namespace content
|