diff options
author | Matthias Wolf <matthias@rheinwolf.de> | 2021-06-17 09:22:35 +0000 |
---|---|---|
committer | Rene Ladan <rene@FreeBSD.org> | 2021-06-17 09:32:02 +0000 |
commit | 9c8545d7801e5a5b68dd4c68d5f0dcb7109015d0 (patch) | |
tree | bd5ba927b4a7b2e0fc9aeef18b17d738079b2edd /www/chromium/files/sandbox_freebsd.h | |
parent | ccd805d32e3522eee71501f122f41f59f99fd1b5 (diff) | |
download | ports-9c8545d7801e5a5b68dd4c68d5f0dcb7109015d0.tar.gz ports-9c8545d7801e5a5b68dd4c68d5f0dcb7109015d0.zip |
www/chromium: update to 91.0.4472.101
Security: https://vuxml.freebsd.org/freebsd/20b3ab21-c9df-11eb-8558-3065ec8fd3ec.html
(cherry picked from commit 06317815238060a3a7f5911f18a3dd7c95779c83)
Diffstat (limited to 'www/chromium/files/sandbox_freebsd.h')
-rw-r--r-- | www/chromium/files/sandbox_freebsd.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/www/chromium/files/sandbox_freebsd.h b/www/chromium/files/sandbox_freebsd.h new file mode 100644 index 000000000000..fffc6262c97f --- /dev/null +++ b/www/chromium/files/sandbox_freebsd.h @@ -0,0 +1,45 @@ +// Copyright (c) 2012 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. +#ifndef SANDBOX_POLICY_FREEBSD_SANDBOX_FREEBSD_H_ +#define SANDBOX_POLICY_FREEBSD_SANDBOX_FREEBSD_H_ + +#include "base/macros.h" +#include "base/memory/singleton.h" +#include "sandbox/policy/export.h" +#include "sandbox/policy/sandbox_type.h" + +namespace sandbox { +namespace policy { + +// A singleton class to represent and change our sandboxing state for the +// capsicum sandbox on FreeBSD. +class SANDBOX_POLICY_EXPORT SandboxFreeBSD { +public: + // Get our singleton instance. + static SandboxFreeBSD* GetInstance(); + + // Get a description for a sandbox type. + static std::string GetSandboxTypeInEnglish(SandboxType sandbox_type); + + // Initializing the Capsicum sandbox. + bool InitializeSandbox(SandboxType sandbox_type); + + // Testing whether the sandbox is enabled. + bool IsSandboxed(); + +private: + friend struct base::DefaultSingletonTraits<SandboxFreeBSD>; + + SandboxFreeBSD(); + ~SandboxFreeBSD(); + + bool initialize_sandbox_ran_; // InitializeSandbox() was called. + + DISALLOW_COPY_AND_ASSIGN(SandboxFreeBSD); +}; + +} // namespace policy +} // namespace sandbox + +#endif // SANDBOX_POLICY_FREBSD_SANDBOX_FREEBSD_H_ |