| Index: chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
|
| diff --git a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
|
| index 5ce91655796e4ec60659c64b6222eea06d44abbc..4890ebaa9691a8962d65f31bbd7d293046b2e287 100644
|
| --- a/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
|
| +++ b/chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h"
|
|
|
| +#include <utility>
|
| +
|
| #include "base/memory/ptr_util.h"
|
| #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h"
|
| #include "chrome/browser/ui/views/chrome_views_delegate.h"
|
| @@ -27,6 +29,10 @@
|
| #endif // defined(USE_AURA)
|
|
|
| #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
|
| +#include <sys/stat.h>
|
| +#include <sys/types.h>
|
| +#include <unistd.h>
|
| +
|
| #include "base/command_line.h"
|
| #include "chrome/browser/ui/simple_message_box.h"
|
| #include "chrome/grit/chromium_strings.h"
|
| @@ -96,6 +102,13 @@ void ChromeBrowserMainExtraPartsViews::PreProfileInit() {
|
| if (geteuid() != 0)
|
| return;
|
|
|
| + // Allow running inside an unprivileged user namespace. In that case, the
|
| + // root directory will be owned by an unmapped UID and GID (although this
|
| + // may not be the case if a chroot is also being used).
|
| + struct stat st;
|
| + if (stat("/", &st) == 0 && st.st_uid != 0)
|
| + return;
|
| +
|
| const base::CommandLine& command_line =
|
| *base::CommandLine::ForCurrentProcess();
|
| if (command_line.HasSwitch(switches::kNoSandbox))
|
|
|