Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(766)

Unified Diff: sandbox/win/src/acl.cc

Issue 2061703002: Fix for running Chrome under a service token. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor nits Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sandbox/win/src/restricted_token_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/acl.cc
diff --git a/sandbox/win/src/acl.cc b/sandbox/win/src/acl.cc
index 539c180b8472f61050b54964f08dca4c943179a9..f2f5ac49e713a2fcda523939095dd73d8ef9e926 100644
--- a/sandbox/win/src/acl.cc
+++ b/sandbox/win/src/acl.cc
@@ -88,8 +88,12 @@ bool RevokeLogonSidFromDefaultDacl(HANDLE token) {
std::unique_ptr<TOKEN_GROUPS, base::FreeDeleter> logon_sid_ptr(logon_sid);
- if (!::GetTokenInformation(token, TokenLogonSid, logon_sid, size, &size))
+ if (!::GetTokenInformation(token, TokenLogonSid, logon_sid, size, &size)) {
+ // If no logon sid, there's nothing to revoke.
+ if (::GetLastError() == ERROR_NOT_FOUND)
+ return true;
return false;
+ }
if (logon_sid->GroupCount < 1) {
::SetLastError(ERROR_INVALID_TOKEN);
return false;
« no previous file with comments | « no previous file | sandbox/win/src/restricted_token_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698