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" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 | 270 |
271 Sid user = reinterpret_cast<SID*>(token_user->User.Sid); | 271 Sid user = reinterpret_cast<SID*>(token_user->User.Sid); |
272 sids_for_deny_only_.push_back(user); | 272 sids_for_deny_only_.push_back(user); |
273 | 273 |
274 delete[] reinterpret_cast<BYTE*>(token_user); | 274 delete[] reinterpret_cast<BYTE*>(token_user); |
275 | 275 |
276 return ERROR_SUCCESS; | 276 return ERROR_SUCCESS; |
277 } | 277 } |
278 | 278 |
279 unsigned RestrictedToken::DeleteAllPrivileges( | 279 unsigned RestrictedToken::DeleteAllPrivileges( |
280 const std::vector<std::wstring> *exceptions) { | 280 const std::vector<base::string16> *exceptions) { |
281 DCHECK(init_); | 281 DCHECK(init_); |
282 if (!init_) | 282 if (!init_) |
283 return ERROR_NO_TOKEN; | 283 return ERROR_NO_TOKEN; |
284 | 284 |
285 // Get the list of privileges in the token | 285 // Get the list of privileges in the token |
286 TOKEN_PRIVILEGES *token_privileges = NULL; | 286 TOKEN_PRIVILEGES *token_privileges = NULL; |
287 DWORD size = 0; | 287 DWORD size = 0; |
288 | 288 |
289 BOOL result = ::GetTokenInformation(effective_token_, | 289 BOOL result = ::GetTokenInformation(effective_token_, |
290 TokenPrivileges, | 290 TokenPrivileges, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 return ERROR_SUCCESS; | 464 return ERROR_SUCCESS; |
465 } | 465 } |
466 | 466 |
467 unsigned RestrictedToken::SetIntegrityLevel(IntegrityLevel integrity_level) { | 467 unsigned RestrictedToken::SetIntegrityLevel(IntegrityLevel integrity_level) { |
468 integrity_level_ = integrity_level; | 468 integrity_level_ = integrity_level; |
469 return ERROR_SUCCESS; | 469 return ERROR_SUCCESS; |
470 } | 470 } |
471 | 471 |
472 } // namespace sandbox | 472 } // namespace sandbox |
OLD | NEW |