OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SERVICES_CREDENTIALS_H_ | 5 #ifndef SANDBOX_LINUX_SERVICES_CREDENTIALS_H_ |
6 #define SANDBOX_LINUX_SERVICES_CREDENTIALS_H_ | 6 #define SANDBOX_LINUX_SERVICES_CREDENTIALS_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 // Link errors are tedious to track, raise a compile-time error instead. | 9 // Link errors are tedious to track, raise a compile-time error instead. |
10 #if defined(OS_ANDROID) | 10 #if defined(OS_ANDROID) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // CAP_SYS_CHROOT can be acquired by using the MoveToNewUserNS() API. | 88 // CAP_SYS_CHROOT can be acquired by using the MoveToNewUserNS() API. |
89 // |proc_fd| must be a file descriptor to /proc/ and must be the only open | 89 // |proc_fd| must be a file descriptor to /proc/ and must be the only open |
90 // directory file descriptor of the process. | 90 // directory file descriptor of the process. |
91 // | 91 // |
92 // CRITICAL: | 92 // CRITICAL: |
93 // - the caller must close |proc_fd| eventually or access to the file | 93 // - the caller must close |proc_fd| eventually or access to the file |
94 // system can be recovered. | 94 // system can be recovered. |
95 // - DropAllCapabilities() must be called to prevent escapes. | 95 // - DropAllCapabilities() must be called to prevent escapes. |
96 static bool DropFileSystemAccess(int proc_fd) WARN_UNUSED_RESULT; | 96 static bool DropFileSystemAccess(int proc_fd) WARN_UNUSED_RESULT; |
97 | 97 |
| 98 // Forks and drops capabilities in the child. |
| 99 static pid_t ForkAndDropCapabilitiesInChild(); |
| 100 |
98 private: | 101 private: |
99 DISALLOW_IMPLICIT_CONSTRUCTORS(Credentials); | 102 DISALLOW_IMPLICIT_CONSTRUCTORS(Credentials); |
100 }; | 103 }; |
101 | 104 |
102 } // namespace sandbox. | 105 } // namespace sandbox. |
103 | 106 |
104 #endif // SANDBOX_LINUX_SERVICES_CREDENTIALS_H_ | 107 #endif // SANDBOX_LINUX_SERVICES_CREDENTIALS_H_ |
OLD | NEW |