summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main_gtk.cc
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 16:37:39 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-08 16:37:39 +0000
commit21b0230e429473ca4c5c35ecb184ef76656bfe3a (patch)
treef23f05ec3627bb86684837f205dfe75a0fc3f56d /chrome/browser/browser_main_gtk.cc
parent3513f78ea41e4542fc1283fd576cdf7e9fda716f (diff)
downloadchromium_src-21b0230e429473ca4c5c35ecb184ef76656bfe3a.zip
chromium_src-21b0230e429473ca4c5c35ecb184ef76656bfe3a.tar.gz
chromium_src-21b0230e429473ca4c5c35ecb184ef76656bfe3a.tar.bz2
Add cmdline switch for folks that really did want to run as root.
BUG=none TEST=none Review URL: http://codereview.chromium.org/6621045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77292 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main_gtk.cc')
-rw-r--r--chrome/browser/browser_main_gtk.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/browser/browser_main_gtk.cc b/chrome/browser/browser_main_gtk.cc
index bd7a040..f59fa9c 100644
--- a/chrome/browser/browser_main_gtk.cc
+++ b/chrome/browser/browser_main_gtk.cc
@@ -76,6 +76,9 @@ void BrowserMainPartsGtk::PreEarlyInitialization() {
void BrowserMainPartsGtk::DetectRunningAsRoot() {
if (geteuid() == 0) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (!parsed_command_line().HasSwitch(switches::kUserDataDir))
+ return;
+
gfx::GtkInitFromCommandLine(command_line);
// Get just enough of our resource machinery up so we can extract the
@@ -94,6 +97,7 @@ void BrowserMainPartsGtk::DetectRunningAsRoot() {
"%s",
message.c_str());
+ LOG(ERROR) << "Startup refusing to run as root.";
message = l10n_util::GetStringFUTF8(
IDS_REFUSE_TO_RUN_AS_ROOT_2,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));