Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable setuid sandbox on linux (backport: 5-0-x) #17343

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions BUILD.gn
Expand Up @@ -917,6 +917,9 @@ dist_zip("electron_dist_zip") {
":licenses",
":electron_version",
]
if (is_linux) {
data_deps += [ "//sandbox/linux:chrome_sandbox" ]
}
outputs = [
"$root_build_dir/dist.zip",
]
Expand Down
4 changes: 0 additions & 4 deletions atom/app/atom_main_delegate.cc
Expand Up @@ -237,10 +237,6 @@ void AtomMainDelegate::PreSandboxStartup() {
if (!IsBrowserProcess(command_line))
return;

// 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);

// Allow file:// URIs to read other file:// URIs by default.
command_line->AppendSwitch(::switches::kAllowFileAccessFromFiles);

Expand Down
5 changes: 4 additions & 1 deletion build/zip.py
Expand Up @@ -61,7 +61,10 @@ def main(argv):
for file in files:
z.write(os.path.join(root, file))
else:
z.write(dep)
basename = os.path.basename(dep)
dirname = os.path.dirname(dep)
arcname = os.path.join(dirname, 'chrome-sandbox') if basename == 'chrome_sandbox' else dep
z.write(dep, arcname)

if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))