electron/patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch
electron-roller[bot] 16f459228b
chore: bump chromium to 108.0.5329.0 (main) (#35628)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-10-03 13:21:00 -07:00

29 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Tue, 16 Apr 2019 11:25:08 -0700
Subject: unsandboxed_ppapi_processes_skip_zygote.patch
Unsandboxed ppapi processes should skip zygote.
diff --git a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
index 72f7193e711e857dccf0387efb95a44215e7a10f..3145e59775a559583e252d8e007bc09e0f1acba0 100644
--- a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
+++ b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
@@ -8,6 +8,7 @@
#include "build/build_config.h"
#include "content/public/common/content_switches.h"
#include "sandbox/policy/mojom/sandbox.mojom.h"
+#include "sandbox/policy/switches.h"
#if BUILDFLAG(IS_WIN)
#include "base/win/windows_version.h"
@@ -63,6 +64,9 @@ bool PpapiPluginSandboxedProcessLauncherDelegate::PreSpawnTarget(
ZygoteHandle PpapiPluginSandboxedProcessLauncherDelegate::GetZygote() {
const base::CommandLine& browser_command_line =
*base::CommandLine::ForCurrentProcess();
+ if (browser_command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) {
+ return nullptr;
+ }
base::CommandLine::StringType plugin_launcher =
browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher);
if (!plugin_launcher.empty())