| 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 "sandbox/win/src/restricted_token.h" | 5 #include "sandbox/win/src/restricted_token.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "sandbox/win/src/acl.h" | 10 #include "sandbox/win/src/acl.h" |
| 11 #include "sandbox/win/src/win_utils.h" | 11 #include "sandbox/win/src/win_utils.h" |
| 12 | 12 |
| 13 namespace sandbox { | 13 namespace sandbox { |
| 14 | 14 |
| 15 RestrictedToken::RestrictedToken() | 15 RestrictedToken::RestrictedToken() |
| 16 : init_(false), | 16 : effective_token_(NULL), |
| 17 effective_token_(NULL), | 17 integrity_level_(INTEGRITY_LEVEL_LAST), |
| 18 integrity_level_(INTEGRITY_LEVEL_LAST) { | 18 init_(false) { |
| 19 } | 19 } |
| 20 | 20 |
| 21 RestrictedToken::~RestrictedToken() { | 21 RestrictedToken::~RestrictedToken() { |
| 22 if (effective_token_) | 22 if (effective_token_) |
| 23 CloseHandle(effective_token_); | 23 CloseHandle(effective_token_); |
| 24 } | 24 } |
| 25 | 25 |
| 26 unsigned RestrictedToken::Init(const HANDLE effective_token) { | 26 unsigned RestrictedToken::Init(const HANDLE effective_token) { |
| 27 if (init_) | 27 if (init_) |
| 28 return ERROR_ALREADY_INITIALIZED; | 28 return ERROR_ALREADY_INITIALIZED; |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 | 472 |
| 473 return ERROR_SUCCESS; | 473 return ERROR_SUCCESS; |
| 474 } | 474 } |
| 475 | 475 |
| 476 unsigned RestrictedToken::SetIntegrityLevel(IntegrityLevel integrity_level) { | 476 unsigned RestrictedToken::SetIntegrityLevel(IntegrityLevel integrity_level) { |
| 477 integrity_level_ = integrity_level; | 477 integrity_level_ = integrity_level; |
| 478 return ERROR_SUCCESS; | 478 return ERROR_SUCCESS; |
| 479 } | 479 } |
| 480 | 480 |
| 481 } // namespace sandbox | 481 } // namespace sandbox |
| OLD | NEW |