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

Unified Diff: base/process/launch.cc

Issue 197213015: [Linux] Use PR_SET_NO_NEW_PRIVS by default in base/process/launch.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add function Created 6 years, 9 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 | « base/process/launch.h ('k') | base/process/launch_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/launch.cc
diff --git a/base/process/launch.cc b/base/process/launch.cc
index 0c9f3a88fef2d9c8384871c6153065512717054d..81748f5f08cc2d913a4727792dc4b72c755e9a63 100644
--- a/base/process/launch.cc
+++ b/base/process/launch.cc
@@ -25,6 +25,7 @@ LaunchOptions::LaunchOptions()
new_process_group(false)
#if defined(OS_LINUX)
, clone_flags(0)
+ , allow_new_privs(false)
#endif // OS_LINUX
#if defined(OS_CHROMEOS)
, ctrl_terminal_fd(-1)
@@ -36,4 +37,15 @@ LaunchOptions::LaunchOptions()
LaunchOptions::~LaunchOptions() {
}
+LaunchOptions LaunchOptionsForTest() {
+ LaunchOptions options;
+#if defined(OS_LINUX)
+ // To prevent accidental privilege sharing to an untrusted child, processes
+ // are started with PR_SET_NO_NEW_PRIVS. Do not set that here, since this
+ // new child will be used for testing only.
+ options.allow_new_privs = true;
+#endif
+ return options;
+}
+
} // namespace base
« no previous file with comments | « base/process/launch.h ('k') | base/process/launch_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698