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_SERVICES_BROKER_PROCESS_H_ | 5 #ifndef SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ |
6 #define SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ | 6 #define SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 // doesn't support execute permissions. | 53 // doesn't support execute permissions. |
54 // It's similar to the access() system call and will return -errno on errors. | 54 // It's similar to the access() system call and will return -errno on errors. |
55 int Access(const char* pathname, int mode) const; | 55 int Access(const char* pathname, int mode) const; |
56 // Can be used in place of open(). Will be async signal safe. | 56 // Can be used in place of open(). Will be async signal safe. |
57 // The implementation only supports certain white listed flags and will | 57 // The implementation only supports certain white listed flags and will |
58 // return -EPERM on other flags. | 58 // return -EPERM on other flags. |
59 // It's similar to the open() system call and will return -errno on errors. | 59 // It's similar to the open() system call and will return -errno on errors. |
60 int Open(const char* pathname, int flags) const; | 60 int Open(const char* pathname, int flags) const; |
61 | 61 |
62 int broker_pid() const { return broker_pid_; } | 62 int broker_pid() const { return broker_pid_; } |
63 int ipc_socketpair() const { return ipc_socketpair_; } | |
jln (very slow on Chromium)
2014/04/09 02:25:47
Maybe add a comment saying that this should only b
| |
63 | 64 |
64 private: | 65 private: |
65 enum IPCCommands { | 66 enum IPCCommands { |
66 kCommandInvalid = 0, | 67 kCommandInvalid = 0, |
67 kCommandOpen, | 68 kCommandOpen, |
68 kCommandAccess, | 69 kCommandAccess, |
69 }; | 70 }; |
70 int PathAndFlagsSyscall(enum IPCCommands command_type, | 71 int PathAndFlagsSyscall(enum IPCCommands command_type, |
71 const char* pathname, | 72 const char* pathname, |
72 int flags) const; | 73 int flags) const; |
(...skipping 22 matching lines...) Expand all Loading... | |
95 pid_t broker_pid_; // The PID of the broker (child). | 96 pid_t broker_pid_; // The PID of the broker (child). |
96 const std::vector<std::string> allowed_r_files_; // Files allowed for read. | 97 const std::vector<std::string> allowed_r_files_; // Files allowed for read. |
97 const std::vector<std::string> allowed_w_files_; // Files allowed for write. | 98 const std::vector<std::string> allowed_w_files_; // Files allowed for write. |
98 int ipc_socketpair_; // Our communication channel to parent or child. | 99 int ipc_socketpair_; // Our communication channel to parent or child. |
99 DISALLOW_IMPLICIT_CONSTRUCTORS(BrokerProcess); | 100 DISALLOW_IMPLICIT_CONSTRUCTORS(BrokerProcess); |
100 }; | 101 }; |
101 | 102 |
102 } // namespace sandbox | 103 } // namespace sandbox |
103 | 104 |
104 #endif // SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ | 105 #endif // SANDBOX_LINUX_SERVICES_BROKER_PROCESS_H_ |
OLD | NEW |