OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SANDBOX_LINUX_SUID_SANDBOX_H_ | 5 #ifndef SANDBOX_LINUX_SUID_SANDBOX_H_ |
6 #define SANDBOX_LINUX_SUID_SANDBOX_H_ | 6 #define SANDBOX_LINUX_SUID_SANDBOX_H_ |
7 | 7 |
8 #if defined(__cplusplus) | 8 #if defined(__cplusplus) |
9 namespace sandbox { | 9 namespace sandbox { |
10 #endif | 10 #endif |
11 | 11 |
12 // These are command line switches that may be used by other programs | 12 // These are command line switches that may be used by other programs |
13 // (e.g. Chrome) to construct a command line for the sandbox. | 13 // (e.g. Chrome) to construct a command line for the sandbox. |
14 static const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score"; | 14 static const char kAdjustOOMScoreSwitch[] = "--adjust-oom-score"; |
15 #if defined(OS_CHROMEOS) | |
16 static const char kAdjustLowMemMarginSwitch[] = "--adjust-low-mem"; | |
17 #endif | |
18 | 15 |
19 static const char kSandboxDescriptorEnvironmentVarName[] = "SBX_D"; | 16 static const char kSandboxDescriptorEnvironmentVarName[] = "SBX_D"; |
20 static const char kSandboxHelperPidEnvironmentVarName[] = "SBX_HELPER_PID"; | 17 static const char kSandboxHelperPidEnvironmentVarName[] = "SBX_HELPER_PID"; |
21 | 18 |
22 static const long kSUIDSandboxApiNumber = 1; | 19 static const long kSUIDSandboxApiNumber = 1; |
23 static const char kSandboxEnvironmentApiRequest[] = "SBX_CHROME_API_RQ"; | 20 static const char kSandboxEnvironmentApiRequest[] = "SBX_CHROME_API_RQ"; |
24 static const char kSandboxEnvironmentApiProvides[] = "SBX_CHROME_API_PRV"; | 21 static const char kSandboxEnvironmentApiProvides[] = "SBX_CHROME_API_PRV"; |
25 | 22 |
26 // This number must be kept in sync with common/zygote_commands_linux.h | 23 // This number must be kept in sync with common/zygote_commands_linux.h |
27 static const int kZygoteIdFd = 7; | 24 static const int kZygoteIdFd = 7; |
28 | 25 |
29 // These are the magic byte values which the sandboxed process uses to request | 26 // These are the magic byte values which the sandboxed process uses to request |
30 // that it be chrooted. | 27 // that it be chrooted. |
31 static const char kMsgChrootMe = 'C'; | 28 static const char kMsgChrootMe = 'C'; |
32 static const char kMsgChrootSuccessful = 'O'; | 29 static const char kMsgChrootSuccessful = 'O'; |
33 | 30 |
34 // These are set if we have respectively switched to a new PID or NET namespace | 31 // These are set if we have respectively switched to a new PID or NET namespace |
35 // by going through the setuid binary helper. | 32 // by going through the setuid binary helper. |
36 static const char kSandboxPIDNSEnvironmentVarName[] = "SBX_PID_NS"; | 33 static const char kSandboxPIDNSEnvironmentVarName[] = "SBX_PID_NS"; |
37 static const char kSandboxNETNSEnvironmentVarName[] = "SBX_NET_NS"; | 34 static const char kSandboxNETNSEnvironmentVarName[] = "SBX_NET_NS"; |
38 | 35 |
39 #if defined(__cplusplus) | 36 #if defined(__cplusplus) |
40 } // namespace sandbox | 37 } // namespace sandbox |
41 #endif | 38 #endif |
42 | 39 |
43 #endif // SANDBOX_LINUX_SUID_SANDBOX_H_ | 40 #endif // SANDBOX_LINUX_SUID_SANDBOX_H_ |
OLD | NEW |