mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 09:36:41 -04:00
Security: https://vuxml.freebsd.org/freebsd/2a3be628-ef6e-11ef-85f3-a8a1599412c6.html Security: https://vuxml.freebsd.org/freebsd/f572b9d1-ef6d-11ef-85f3-a8a1599412c6.html Security: https://vuxml.freebsd.org/freebsd/b09d0b3b-ef6d-11ef-85f3-a8a1599412c6.html
37 lines
1.5 KiB
C++
37 lines
1.5 KiB
C++
--- content/browser/browser_main_loop.cc.orig 2025-02-19 07:43:18 UTC
|
|
+++ content/browser/browser_main_loop.cc
|
|
@@ -247,6 +247,12 @@
|
|
#include "mojo/public/cpp/bindings/lib/test_random_mojo_delays.h"
|
|
#endif
|
|
|
|
+#if BUILDFLAG(IS_BSD)
|
|
+#include "content/browser/sandbox_host_linux.h"
|
|
+#include "content/public/common/zygote/sandbox_support_linux.h"
|
|
+#include "sandbox/policy/sandbox.h"
|
|
+#endif
|
|
+
|
|
// One of the linux specific headers defines this as a macro.
|
|
#ifdef DestroyAll
|
|
#undef DestroyAll
|
|
@@ -541,6 +547,12 @@ int BrowserMainLoop::EarlyInitialization() {
|
|
// by now since a thread to start the ServiceManager has been created
|
|
// before the browser main loop starts.
|
|
DCHECK(SandboxHostLinux::GetInstance()->IsInitialized());
|
|
+#elif BUILDFLAG(IS_BSD)
|
|
+ base::FileHandleMappingVector additional_remapped_fds;
|
|
+ base::LaunchOptions options;
|
|
+ SandboxHostLinux::GetInstance()->Init();
|
|
+ const int sfd = SandboxHostLinux::GetInstance()->GetChildSocket();
|
|
+ options.fds_to_remap.push_back(std::make_pair(sfd, GetSandboxFD()));
|
|
#endif
|
|
|
|
// GLib's spawning of new processes is buggy, so it's important that at this
|
|
@@ -573,7 +585,7 @@ int BrowserMainLoop::EarlyInitialization() {
|
|
base::ThreadType::kDisplayCritical);
|
|
|
|
#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || \
|
|
- BUILDFLAG(IS_ANDROID)
|
|
+ BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_BSD)
|
|
// We use quite a few file descriptors for our IPC as well as disk the disk
|
|
// cache, and the default limit on Apple is low (256), so bump it up.
|
|
|