diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-30 10:24:29 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-30 10:24:29 +0000 |
commit | 334ee163a38700ea2c4618a50acfbb826ada22a1 (patch) | |
tree | 22475e8c1391dddea80dafb3dc6452973c1e86af | |
parent | ad9cfab9432915d60191675aea6be9cc33a9ce01 (diff) | |
download | chromium_src-334ee163a38700ea2c4618a50acfbb826ada22a1.zip chromium_src-334ee163a38700ea2c4618a50acfbb826ada22a1.tar.gz chromium_src-334ee163a38700ea2c4618a50acfbb826ada22a1.tar.bz2 |
Don't use no_new_privs mode when running NM process on Linux
BUG=378012
Review URL: https://codereview.chromium.org/304083002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273785 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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 2a75aba..a38d4b7 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; |