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 #include <aclapi.h> | 5 #include <aclapi.h> |
6 #include <sddl.h> | 6 #include <sddl.h> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "sandbox/src/restricted_token_utils.h" | 9 #include "sandbox/win/src/restricted_token_utils.h" |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/win/scoped_handle.h" | 12 #include "base/win/scoped_handle.h" |
13 #include "base/win/scoped_process_information.h" | 13 #include "base/win/scoped_process_information.h" |
14 #include "base/win/windows_version.h" | 14 #include "base/win/windows_version.h" |
15 #include "sandbox/src/job.h" | 15 #include "sandbox/win/src/job.h" |
16 #include "sandbox/src/restricted_token.h" | 16 #include "sandbox/win/src/restricted_token.h" |
17 #include "sandbox/src/security_level.h" | 17 #include "sandbox/win/src/security_level.h" |
18 #include "sandbox/src/sid.h" | 18 #include "sandbox/win/src/sid.h" |
19 | 19 |
20 namespace sandbox { | 20 namespace sandbox { |
21 | 21 |
22 DWORD CreateRestrictedToken(HANDLE *token_handle, | 22 DWORD CreateRestrictedToken(HANDLE *token_handle, |
23 TokenLevel security_level, | 23 TokenLevel security_level, |
24 IntegrityLevel integrity_level, | 24 IntegrityLevel integrity_level, |
25 TokenType token_type) { | 25 TokenType token_type) { |
26 if (!token_handle) | 26 if (!token_handle) |
27 return ERROR_BAD_ARGUMENTS; | 27 return ERROR_BAD_ARGUMENTS; |
28 | 28 |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 if (!::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_DEFAULT, | 335 if (!::OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_DEFAULT, |
336 &token_handle)) | 336 &token_handle)) |
337 return ::GetLastError(); | 337 return ::GetLastError(); |
338 | 338 |
339 base::win::ScopedHandle token(token_handle); | 339 base::win::ScopedHandle token(token_handle); |
340 | 340 |
341 return SetTokenIntegrityLevel(token.Get(), integrity_level); | 341 return SetTokenIntegrityLevel(token.Get(), integrity_level); |
342 } | 342 } |
343 | 343 |
344 } // namespace sandbox | 344 } // namespace sandbox |
OLD | NEW |