diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 14:04:48 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-05 14:04:48 +0000 |
commit | 882f1d56a6183e907e17573a57312712167122b0 (patch) | |
tree | a33d8dc6f07982007bdb00642699a5ec51e8b6bc /chrome/browser | |
parent | 1c5fdc4aa3b54cbc3a103e26af918188afbe8b66 (diff) | |
download | chromium_src-882f1d56a6183e907e17573a57312712167122b0.zip chromium_src-882f1d56a6183e907e17573a57312712167122b0.tar.gz chromium_src-882f1d56a6183e907e17573a57312712167122b0.tar.bz2 |
TBR: mark@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/utility.sb | 40 | ||||
-rw-r--r-- | chrome/browser/utility_process_host.cc | 9 | ||||
-rw-r--r-- | chrome/browser/worker.sb | 35 |
3 files changed, 81 insertions, 3 deletions
diff --git a/chrome/browser/utility.sb b/chrome/browser/utility.sb new file mode 100644 index 0000000..291e677 --- /dev/null +++ b/chrome/browser/utility.sb @@ -0,0 +1,40 @@ +;; +;; Copyright (c) 2009 The Chromium Authors. All rights reserved. +;; Use of this source code is governed by a BSD-style license that can be +;; found in the LICENSE file. +;; +; This is the Sandbox configuration file used for safeguarding the utility +; process which is used for performing sandboxed operations that need to touch +; the filesystem like decoding theme images and unpacking extensions. +; +; This configuration locks everything down, except access to one configurable +; directory. This is different from other sandbox configuration files where +; file system access is entireley restricted. +(version 1) +(deny default) +; Support for programmatically enabling verbose debugging. +;ENABLE_LOGGING (debug deny) + +; Allow sending signals to self - http://crbug.com/20370 +(allow signal (target self)) + +; Needed for full-page-zoomed controls - http://crbug.com/11325 +(allow sysctl-read) + +; Each line is marked with the System version that needs it. +; This profile is tested with the following system versions: +; 10.5.6, 10.6 + +; Allow following symlinks +(allow file-read-metadata) ; 10.5.6 + +; Loading System Libraries. +(allow file-read-data (regex #"^/System/Library/Frameworks")) ; 10.5.6 +(allow file-read-data (regex #"^/System/Library/PrivateFrameworks")) ; 10.5.6 +(allow file-read-data (regex #"^/System/Library/CoreServices")) ; 10.5.6 + +; Needed for IPC on 10.6 +;10.6_ONLY (allow ipc-posix-shm) + +; Enable full access to given directory. +(allow file-read* file-write* (regex #"^DIR_TO_ALLOW_ACCESS")) diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc index af35c36..1ba7068 100644 --- a/chrome/browser/utility_process_host.cc +++ b/chrome/browser/utility_process_host.cc @@ -67,8 +67,8 @@ FilePath UtilityProcessHost::GetUtilityProcessCmd() { bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) { #if defined(OS_POSIX) - // TODO(port): We should not reach here on linux (crbug.com/22703) or - // MacOS (crbug.com/8102) until problems related to autoupdate are fixed. + // TODO(port): We should not reach here on Linux (crbug.com/22703). + // (crbug.com/23837) covers enabling this on Linux/OS X. NOTREACHED(); return false; #endif @@ -113,7 +113,7 @@ bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) { process = sandbox::StartProcessWithAccess(&cmd_line, exposed_dir); } #else - // TODO(port): Sandbox this on Linux/Mac. Also, zygote this to work with + // TODO(port): Sandbox this on Linux. Also, zygote this to work with // Linux updating. bool has_cmd_prefix = browser_command_line.HasSwitch( switches::kUtilityCmdPrefix); @@ -124,6 +124,9 @@ bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) { switches::kUtilityCmdPrefix)); } + cmd_line.AppendSwitchWithValue(switches::kUtilityProcessAllowedDir, + exposed_dir.value().c_str()); + // This code is duplicated with browser_render_process_host.cc and // plugin_process_host.cc, but there's not a good place to de-duplicate it. // Maybe we can merge this into sandbox::StartProcess which will set up diff --git a/chrome/browser/worker.sb b/chrome/browser/worker.sb new file mode 100644 index 0000000..bc208c4 --- /dev/null +++ b/chrome/browser/worker.sb @@ -0,0 +1,35 @@ +;; +;; Copyright (c) 2009 The Chromium Authors. All rights reserved. +;; Use of this source code is governed by a BSD-style license that can be +;; found in the LICENSE file. +;; +; This is the Sandbox configuration file used for safeguarding the worker +; process which is used to run web workers in a sandboxed environment. +; +; This is the most restrictive sandbox profile and only enables just enough +; to allow basic use of Cocoa. +(version 1) +(deny default) +; Support for programmatically enabling verbose debugging. +;ENABLE_LOGGING (debug deny) + +; Allow sending signals to self - http://crbug.com/20370 +(allow signal (target self)) + +; Needed for full-page-zoomed controls - http://crbug.com/11325 +(allow sysctl-read) + +; Each line is marked with the System version that needs it. +; This profile is tested with the following system versions: +; 10.5.6, 10.6 + +; Allow following symlinks +(allow file-read-metadata) ; 10.5.6 + +; Loading System Libraries. +(allow file-read-data (regex #"^/System/Library/Frameworks")) ; 10.5.6 +(allow file-read-data (regex #"^/System/Library/PrivateFrameworks")) ; 10.5.6 +(allow file-read-data (regex #"^/System/Library/CoreServices")) ; 10.5.6 + +; Needed for IPC on 10.6 +;10.6_ONLY (allow ipc-posix-shm) |