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

Unified Diff: apps/load_and_launch_browsertest.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: Address jln's comments 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 | « no previous file | base/process/launch.h » ('j') | sandbox/linux/suid/sandbox.c » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/load_and_launch_browsertest.cc
diff --git a/apps/load_and_launch_browsertest.cc b/apps/load_and_launch_browsertest.cc
index fecfe844f1465afcf4d45a653e069875495da995..6cc484aba5feccadce5f7750bec2e138a0d623f8 100644
--- a/apps/load_and_launch_browsertest.cc
+++ b/apps/load_and_launch_browsertest.cc
@@ -50,8 +50,15 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
app_path.value());
new_cmdline.AppendSwitch(content::kLaunchAsBrowser);
+ base::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 a test browser process.
+ options.allow_new_privs = true;
+#endif
base::ProcessHandle process;
- base::LaunchProcess(new_cmdline, base::LaunchOptions(), &process);
+ base::LaunchProcess(new_cmdline, options, &process);
ASSERT_NE(base::kNullProcessHandle, process);
ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
@@ -93,8 +100,15 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
new_cmdline.AppendSwitch(content::kLaunchAsBrowser);
new_cmdline.AppendArgPath(test_file_path);
+ base::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 a test browser process.
+ options.allow_new_privs = true;
+#endif
base::ProcessHandle process;
- base::LaunchProcess(new_cmdline, base::LaunchOptions(), &process);
+ base::LaunchProcess(new_cmdline, options, &process);
ASSERT_NE(base::kNullProcessHandle, process);
ASSERT_TRUE(launched_listener.WaitUntilSatisfied());
« no previous file with comments | « no previous file | base/process/launch.h » ('j') | sandbox/linux/suid/sandbox.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698