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

Side by Side Diff: chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc

Issue 2578483002: Namespace sandbox: add check for unprivileged use of CLONE_NEWUSER (Closed)
Patch Set: Disallow root even with --user-data-dir Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | sandbox/linux/services/credentials.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h"
6 6
7 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" 7 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h"
8 #include "chrome/browser/ui/views/chrome_views_delegate.h" 8 #include "chrome/browser/ui/views/chrome_views_delegate.h"
9 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" 9 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h"
10 #include "components/constrained_window/constrained_window_views.h" 10 #include "components/constrained_window/constrained_window_views.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 IMEDriver::Register(); 69 IMEDriver::Register();
70 #endif 70 #endif
71 71
72 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 72 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
73 // On the Linux desktop, we want to prevent the user from logging in as root, 73 // On the Linux desktop, we want to prevent the user from logging in as root,
74 // so that we don't destroy the profile. Now that we have some minimal ui 74 // so that we don't destroy the profile. Now that we have some minimal ui
75 // initialized, check to see if we're running as root and bail if we are. 75 // initialized, check to see if we're running as root and bail if we are.
76 if (getuid() != 0) 76 if (getuid() != 0)
77 return; 77 return;
78 78
79 const base::CommandLine& command_line =
sky 2017/01/05 23:21:59 Can you update the description to indicate why we
Tom (Use chromium acct) 2017/01/06 00:18:38 Updated the CL description.
80 *base::CommandLine::ForCurrentProcess();
81 if (command_line.HasSwitch(switches::kUserDataDir))
82 return;
83
84 base::string16 title = l10n_util::GetStringFUTF16( 79 base::string16 title = l10n_util::GetStringFUTF16(
85 IDS_REFUSE_TO_RUN_AS_ROOT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 80 IDS_REFUSE_TO_RUN_AS_ROOT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
86 base::string16 message = l10n_util::GetStringFUTF16( 81 base::string16 message = l10n_util::GetStringFUTF16(
87 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 82 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
88 83
89 chrome::ShowWarningMessageBox(NULL, title, message); 84 chrome::ShowWarningMessageBox(NULL, title, message);
90 85
91 // Avoids gpu_process_transport_factory.cc(153)] Check failed: 86 // Avoids gpu_process_transport_factory.cc(153)] Check failed:
92 // per_compositor_data_.empty() when quit is chosen. 87 // per_compositor_data_.empty() when quit is chosen.
93 base::RunLoop().RunUntilIdle(); 88 base::RunLoop().RunUntilIdle();
(...skipping 19 matching lines...) Expand all
113 &server); 108 &server);
114 input_device_client_->Connect(std::move(server)); 109 input_device_client_->Connect(std::move(server));
115 110
116 window_manager_connection_ = views::WindowManagerConnection::Create( 111 window_manager_connection_ = views::WindowManagerConnection::Create(
117 connection->GetConnector(), connection->GetIdentity(), 112 connection->GetConnector(), connection->GetIdentity(),
118 content::BrowserThread::GetTaskRunnerForThread( 113 content::BrowserThread::GetTaskRunnerForThread(
119 content::BrowserThread::IO)); 114 content::BrowserThread::IO));
120 } 115 }
121 #endif // defined(USE_AURA) 116 #endif // defined(USE_AURA)
122 } 117 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | sandbox/linux/services/credentials.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698