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

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: Add comment 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 "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" 8 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h"
9 #include "chrome/browser/ui/views/chrome_views_delegate.h" 9 #include "chrome/browser/ui/views/chrome_views_delegate.h"
10 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h" 10 #include "chrome/browser/ui/views/ime_driver/ime_driver_mus.h"
(...skipping 11 matching lines...) Expand all
22 #include "services/ui/public/interfaces/input_devices/input_device_server.mojom. h" 22 #include "services/ui/public/interfaces/input_devices/input_device_server.mojom. h"
23 #include "ui/display/screen.h" 23 #include "ui/display/screen.h"
24 #include "ui/views/mus/mus_client.h" 24 #include "ui/views/mus/mus_client.h"
25 #include "ui/views/widget/desktop_aura/desktop_screen.h" 25 #include "ui/views/widget/desktop_aura/desktop_screen.h"
26 #include "ui/wm/core/wm_state.h" 26 #include "ui/wm/core/wm_state.h"
27 #endif // defined(USE_AURA) 27 #endif // defined(USE_AURA)
28 28
29 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 29 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
30 #include "base/command_line.h" 30 #include "base/command_line.h"
31 #include "chrome/browser/ui/simple_message_box.h" 31 #include "chrome/browser/ui/simple_message_box.h"
32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/grit/chromium_strings.h" 32 #include "chrome/grit/chromium_strings.h"
34 #include "chrome/grit/generated_resources.h" 33 #include "chrome/grit/generated_resources.h"
34 #include "content/public/common/content_switches.h"
35 #include "ui/base/l10n/l10n_util.h" 35 #include "ui/base/l10n/l10n_util.h"
36 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) 36 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
37 37
38 ChromeBrowserMainExtraPartsViews::ChromeBrowserMainExtraPartsViews() { 38 ChromeBrowserMainExtraPartsViews::ChromeBrowserMainExtraPartsViews() {
39 } 39 }
40 40
41 ChromeBrowserMainExtraPartsViews::~ChromeBrowserMainExtraPartsViews() { 41 ChromeBrowserMainExtraPartsViews::~ChromeBrowserMainExtraPartsViews() {
42 constrained_window::SetConstrainedWindowViewsClient(nullptr); 42 constrained_window::SetConstrainedWindowViewsClient(nullptr);
43 } 43 }
44 44
(...skipping 22 matching lines...) Expand all
67 #if defined(USE_AURA) 67 #if defined(USE_AURA)
68 // IME driver must be available at login screen, so initialize before profile. 68 // IME driver must be available at login screen, so initialize before profile.
69 if (service_manager::ServiceManagerIsRemote()) 69 if (service_manager::ServiceManagerIsRemote())
70 IMEDriver::Register(); 70 IMEDriver::Register();
71 #endif 71 #endif
72 72
73 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 73 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
74 // On the Linux desktop, we want to prevent the user from logging in as root, 74 // On the Linux desktop, we want to prevent the user from logging in as root,
75 // so that we don't destroy the profile. Now that we have some minimal ui 75 // so that we don't destroy the profile. Now that we have some minimal ui
76 // initialized, check to see if we're running as root and bail if we are. 76 // initialized, check to see if we're running as root and bail if we are.
77 if (getuid() != 0) 77 if (geteuid() != 0)
78 return; 78 return;
79 79
80 const base::CommandLine& command_line = 80 const base::CommandLine& command_line =
81 *base::CommandLine::ForCurrentProcess(); 81 *base::CommandLine::ForCurrentProcess();
82 if (command_line.HasSwitch(switches::kUserDataDir)) 82 if (command_line.HasSwitch(switches::kNoSandbox))
83 return; 83 return;
84 84
85 base::string16 title = l10n_util::GetStringFUTF16( 85 base::string16 title = l10n_util::GetStringFUTF16(
86 IDS_REFUSE_TO_RUN_AS_ROOT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 86 IDS_REFUSE_TO_RUN_AS_ROOT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
87 base::string16 message = l10n_util::GetStringFUTF16( 87 base::string16 message = l10n_util::GetStringFUTF16(
88 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 88 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
89 89
90 chrome::ShowWarningMessageBox(NULL, title, message); 90 chrome::ShowWarningMessageBox(NULL, title, message);
91 91
92 // Avoids gpu_process_transport_factory.cc(153)] Check failed: 92 // Avoids gpu_process_transport_factory.cc(153)] Check failed:
(...skipping 23 matching lines...) Expand all
116 // WMState is owned as a member, so don't have MusClient create it. 116 // WMState is owned as a member, so don't have MusClient create it.
117 const bool create_wm_state = false; 117 const bool create_wm_state = false;
118 mus_client_ = base::MakeUnique<views::MusClient>( 118 mus_client_ = base::MakeUnique<views::MusClient>(
119 connection->GetConnector(), connection->GetIdentity(), 119 connection->GetConnector(), connection->GetIdentity(),
120 content::BrowserThread::GetTaskRunnerForThread( 120 content::BrowserThread::GetTaskRunnerForThread(
121 content::BrowserThread::IO), 121 content::BrowserThread::IO),
122 create_wm_state); 122 create_wm_state);
123 } 123 }
124 #endif // defined(USE_AURA) 124 #endif // defined(USE_AURA)
125 } 125 }
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