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 |