Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3878)

Unified Diff: chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc

Issue 304083002: Don't use no_new_privs mode when running NM process on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
index 2a75aba1d3903069df5db39c7333a9093a662c79..a38d4b7f12aedd975fbffdddfff242923b73d4b3 100644
--- a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
+++ b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
@@ -11,6 +11,7 @@
#include "base/path_service.h"
#include "base/posix/eintr_wrapper.h"
#include "base/process/launch.h"
+#include "build/build_config.h"
#include "chrome/common/chrome_paths.h"
namespace extensions {
@@ -74,6 +75,12 @@ bool NativeProcessLauncher::LaunchNativeProcess(
base::LaunchOptions options;
options.fds_to_remap = &fd_map;
+
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ // Don't use no_new_privs mode, e.g. in case the host needs to use sudo.
+ options.allow_new_privs = true;
+#endif
+
if (!base::LaunchProcess(command_line, options, process_handle)) {
LOG(ERROR) << "Error launching process";
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698