| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_HOST_H_ | 5 #ifndef SANDBOX_LINUX_SUID_SETUID_SANDBOX_HOST_H_ |
| 6 #define SANDBOX_LINUX_SUID_SETUID_SANDBOX_HOST_H_ | 6 #define SANDBOX_LINUX_SUID_SETUID_SANDBOX_HOST_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 9 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/process/launch.h" | 13 #include "base/process/launch.h" |
| 13 #include "sandbox/sandbox_export.h" | 14 #include "sandbox/sandbox_export.h" |
| 14 | 15 |
| 15 namespace sandbox { | 16 namespace sandbox { |
| 16 | 17 |
| 17 // Helper class to use the setuid sandbox. This class is to be used | 18 // Helper class to use the setuid sandbox. This class is to be used |
| 18 // before launching the setuid helper. | 19 // before launching the setuid helper. |
| 19 // This class is difficult to use. It has been created by refactoring very old | 20 // This class is difficult to use. It has been created by refactoring very old |
| 20 // code scathered through the Chromium code base. | 21 // code scathered through the Chromium code base. |
| 21 // | 22 // |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 base::FileHandleMappingVector* fds_to_remap, | 54 base::FileHandleMappingVector* fds_to_remap, |
| 54 base::ScopedFD* dummy_fd); | 55 base::ScopedFD* dummy_fd); |
| 55 // Set-up the environment. This should be done prior to launching the setuid | 56 // Set-up the environment. This should be done prior to launching the setuid |
| 56 // helper. | 57 // helper. |
| 57 void SetupLaunchEnvironment(); | 58 void SetupLaunchEnvironment(); |
| 58 | 59 |
| 59 private: | 60 private: |
| 60 explicit SetuidSandboxHost(base::Environment* env); | 61 explicit SetuidSandboxHost(base::Environment* env); |
| 61 | 62 |
| 62 // Holds the environment. Will never be NULL. | 63 // Holds the environment. Will never be NULL. |
| 63 scoped_ptr<base::Environment> env_; | 64 std::unique_ptr<base::Environment> env_; |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(SetuidSandboxHost); | 66 DISALLOW_COPY_AND_ASSIGN(SetuidSandboxHost); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace sandbox | 69 } // namespace sandbox |
| 69 | 70 |
| 70 #endif // SANDBOX_LINUX_SUID_SETUID_SANDBOX_HOST_H_ | 71 #endif // SANDBOX_LINUX_SUID_SETUID_SANDBOX_HOST_H_ |
| OLD | NEW |