Skip to content

Commit

Permalink
fix: always disable setuid sandbox on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Nov 14, 2018
1 parent b53a858 commit 34de1a5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions atom/app/atom_main_delegate.cc
Expand Up @@ -209,16 +209,14 @@ void AtomMainDelegate::PreSandboxStartup() {
if (!IsBrowserProcess(command_line))
return;

if (!command_line->HasSwitch(switches::kEnableMixedSandbox)) {
if (command_line->HasSwitch(switches::kEnableSandbox)) {
// Disable setuid sandbox since it is not longer required on
// linux(namespace sandbox is available on most distros).
command_line->AppendSwitch(
service_manager::switches::kDisableSetuidSandbox);
} else {
// Disable renderer sandbox for most of node's functions.
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
}
// Disable setuid sandbox since it is not longer required on
// linux (namespace sandbox is available on most distros).
command_line->AppendSwitch(service_manager::switches::kDisableSetuidSandbox);

if (!command_line->HasSwitch(switches::kEnableMixedSandbox) &&
!command_line->HasSwitch(switches::kEnableSandbox)) {
// Disable renderer sandbox for most of node's functions.
command_line->AppendSwitch(service_manager::switches::kNoSandbox);
}

// Allow file:// URIs to read other file:// URIs by default.
Expand Down

0 comments on commit 34de1a5

Please sign in to comment.