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 #include "sandbox/linux/services/credentials.h" | 5 #include "sandbox/linux/services/credentials.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <sys/capability.h> | 10 #include <sys/capability.h> |
11 #include <sys/syscall.h> | 11 #include <sys/syscall.h> |
12 #include <sys/types.h> | 12 #include <sys/types.h> |
13 #include <sys/wait.h> | 13 #include <sys/wait.h> |
14 #include <unistd.h> | 14 #include <unistd.h> |
15 | 15 |
16 #include "base/basictypes.h" | 16 #include "base/basictypes.h" |
17 #include "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/files/file_path.h" | 18 #include "base/files/file_path.h" |
19 #include "base/files/file_util.h" | 19 #include "base/files/file_util.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/posix/eintr_wrapper.h" | 21 #include "base/posix/eintr_wrapper.h" |
22 #include "base/process/process.h" | 22 #include "base/process/launch.h" |
23 #include "base/template_util.h" | 23 #include "base/template_util.h" |
24 #include "base/third_party/valgrind/valgrind.h" | 24 #include "base/third_party/valgrind/valgrind.h" |
25 #include "sandbox/linux/services/syscall_wrappers.h" | 25 #include "sandbox/linux/services/syscall_wrappers.h" |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 bool IsRunningOnValgrind() { return RUNNING_ON_VALGRIND; } | 29 bool IsRunningOnValgrind() { return RUNNING_ON_VALGRIND; } |
30 | 30 |
31 struct CapFreeDeleter { | 31 struct CapFreeDeleter { |
32 inline void operator()(cap_t cap) const { | 32 inline void operator()(cap_t cap) const { |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 229 } |
230 | 230 |
231 bool Credentials::DropFileSystemAccess() { | 231 bool Credentials::DropFileSystemAccess() { |
232 CHECK(ChrootToSafeEmptyDir()); | 232 CHECK(ChrootToSafeEmptyDir()); |
233 CHECK(!base::DirectoryExists(base::FilePath("/proc"))); | 233 CHECK(!base::DirectoryExists(base::FilePath("/proc"))); |
234 // We never let this function fail. | 234 // We never let this function fail. |
235 return true; | 235 return true; |
236 } | 236 } |
237 | 237 |
238 } // namespace sandbox. | 238 } // namespace sandbox. |
OLD | NEW |