OLD | NEW |
---|---|
1 ;; | 1 ;; |
2 ;; Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 ;; Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 ;; Use of this source code is governed by a BSD-style license that can be | 3 ;; Use of this source code is governed by a BSD-style license that can be |
4 ;; found in the LICENSE file. | 4 ;; found in the LICENSE file. |
5 ;; | 5 ;; |
6 ; This configuration file isn't used on it's own, but instead implicitly | 6 ; This configuration file isn't used on it's own, but instead implicitly |
7 ; included at the start of all other sandbox configuration files in Chrome. | 7 ; included at the start of all other sandbox configuration files in Chrome. |
8 (version 1) | 8 (version 1) |
9 | 9 |
10 ; DISABLE_SANDBOX_DENIAL_LOGGING expands to syntax that turns off log message | 10 ; Helper function to check if a param is set to true |
11 (define (param-true? str) (string=? (param str) "TRUE")) | |
12 | |
13 ; Helper function to determine if a parameter is defined or not | |
14 ; Very simple function but it makes the code clearer | |
15 (define (param-defined? str) (string? (param str))) | |
16 | |
17 ; Define constants for all of the parameter strings passed in | |
18 (define disable-sandbox-denial-logging "DISABLE_SANDBOX_DENIAL_LOGGING") | |
19 (define enable-logging "ENABLE_LOGGING") | |
20 (define component-build-workaround "COMPONENT_BUILD_WORKAROUND") | |
21 (define perm-dir "PERMITTED_DIR") | |
22 (define lion-or-later "LION_OR_LATER") | |
23 (define homedir-as-literal "USER_HOMEDIR_AS_LITERAL") | |
24 | |
25 ; DISABLE_SANDBOX_DENIAL_LOGGING turns off log message | |
11 ; printing on sandbox exceptions; this functionality only exists on 10.6. The | 26 ; printing on sandbox exceptions; this functionality only exists on 10.6. The |
12 ; --enable-sandbox-logging flag or system versions <10.6 cause this flag to | 27 ; --enable-sandbox-logging flag or system versions <10.6 cause this flag to |
13 ; expand to an empty string. http://crbug.com/26621 | 28 ; expand to an empty string. http://crbug.com/26621 |
14 (deny default @DISABLE_SANDBOX_DENIAL_LOGGING@) | 29 (if (param-true? disable-sandbox-denial-logging) |
30 (deny default (with no-log)) | |
31 (deny default)) | |
15 | 32 |
16 ; Support for programmatically enabling verbose debugging. | 33 ; Support for programmatically enabling verbose debugging. |
17 ;ENABLE_LOGGING (debug deny) | 34 (if (param-true? enable-logging) (debug deny)) |
18 | 35 |
19 ; Allow sending signals to self - http://crbug.com/20370 | 36 ; Allow sending signals to self - http://crbug.com/20370 |
20 (allow signal (target self)) | 37 (allow signal (target self)) |
21 | 38 |
22 ; Needed for full-page-zoomed controls - http://crbug.com/11325 | 39 ; Needed for full-page-zoomed controls - http://crbug.com/11325 |
23 (allow sysctl-read) | 40 (allow sysctl-read) |
24 | 41 |
25 ; Each line is marked with the System version that needs it. | 42 ; Each line is marked with the System version that needs it. |
Robert Sesek
2015/06/16 23:52:40
Delete this comment, since I don't think it's true
| |
26 ; This profile is tested with the following system versions: | 43 ; This profile is tested with the following system versions: |
27 ; 10.5.6, 10.6 | 44 ; 10.5.6, 10.6 |
28 | 45 |
29 ; Loading System Libraries. | 46 ; Loading System Libraries. |
30 (allow file-read* | 47 (allow file-read* |
31 (regex #"^/System/Library/Frameworks($|/)") | 48 (regex #"^/System/Library/Frameworks($|/)") |
32 (regex #"^/System/Library/PrivateFrameworks($|/)") | 49 (regex #"^/System/Library/PrivateFrameworks($|/)") |
33 (regex #"^/System/Library/CoreServices($|/)")) ; 10.5.6 | 50 (regex #"^/System/Library/CoreServices($|/)")) |
34 | 51 |
35 ; Needed for IPC on 10.6 | 52 ; Needed for IPC on 10.6 |
36 (allow ipc-posix-shm) | 53 (allow ipc-posix-shm) |
37 | 54 |
38 ; Allow direct access to /dev/urandom, similar to Linux/POSIX, to allow | 55 ; Allow direct access to /dev/urandom, similar to Linux/POSIX, to allow |
39 ; third party code (eg: bits of Adobe Flash and NSS) to function properly. | 56 ; third party code (eg: bits of Adobe Flash and NSS) to function properly. |
40 (allow file-read-data file-read-metadata (literal "/dev/urandom")) | 57 (allow file-read-data file-read-metadata (literal "/dev/urandom")) |
41 | 58 |
42 ; Component build workaround for a dyld bug, used on OS X <= 10.6. | 59 ; Component build workaround for a dyld bug, used on OS X <= 10.6. |
43 ; Enables reading file metadata for the Chrome bundle and its parent paths. | 60 ; Enables reading file metadata for the Chrome bundle and its parent paths. |
44 ; http://crbug.com/127465 | 61 ; http://crbug.com/127465 |
45 @COMPONENT_BUILD_WORKAROUND@ | 62 (if (param-defined? component-build-workaround) |
63 (allow file-read-metadata )) | |
OLD | NEW |