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_SETUID_SANDBOX_CLIENT_H_ | 5 #ifndef SANDBOX_LINUX_SUID_CLIENT_SETUID_SANDBOX_CLIENT_H_ |
6 #define SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_ | 6 #define SANDBOX_LINUX_SUID_CLIENT_SETUID_SANDBOX_CLIENT_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "sandbox/sandbox_export.h" | 12 #include "sandbox/sandbox_export.h" |
13 | 13 |
14 namespace sandbox { | 14 namespace sandbox { |
15 | 15 |
16 // Helper class to use the setuid sandbox. This class is to be used | 16 // Helper class to use the setuid sandbox. This class is to be used |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Did we get launched through the setuid helper ? | 51 // Did we get launched through the setuid helper ? |
52 bool IsSuidSandboxChild() const; | 52 bool IsSuidSandboxChild() const; |
53 // Did the setuid helper create a new PID namespace ? | 53 // Did the setuid helper create a new PID namespace ? |
54 bool IsInNewPIDNamespace() const; | 54 bool IsInNewPIDNamespace() const; |
55 // Did the setuid helper create a new network namespace ? | 55 // Did the setuid helper create a new network namespace ? |
56 bool IsInNewNETNamespace() const; | 56 bool IsInNewNETNamespace() const; |
57 // Are we done and fully sandboxed ? | 57 // Are we done and fully sandboxed ? |
58 bool IsSandboxed() const; | 58 bool IsSandboxed() const; |
59 | 59 |
60 private: | 60 private: |
61 explicit SetuidSandboxClient(base::Environment* env); | 61 explicit SetuidSandboxClient(std::unique_ptr<base::Environment> env); |
62 | 62 |
63 // Holds the environment. Will never be NULL. | 63 // Holds the environment. Will never be NULL. |
64 std::unique_ptr<base::Environment> env_; | 64 std::unique_ptr<base::Environment> env_; |
65 bool sandboxed_; | 65 bool sandboxed_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(SetuidSandboxClient); | 67 DISALLOW_COPY_AND_ASSIGN(SetuidSandboxClient); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace sandbox | 70 } // namespace sandbox |
71 | 71 |
72 #endif // SANDBOX_LINUX_SUID_SETUID_SANDBOX_CLIENT_H_ | 72 #endif // SANDBOX_LINUX_SUID_CLIENT_SETUID_SANDBOX_CLIENT_H_ |
OLD | NEW |