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

Side by Side Diff: sandbox/win/src/broker_services.cc

Issue 977193002: Adding lowbox condition to IsTokenCacheable function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Modified comment. Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/broker_services.h" 5 #include "sandbox/win/src/broker_services.h"
6 6
7 #include <AclAPI.h> 7 #include <AclAPI.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 NOTREACHED(); 81 NOTREACHED();
82 } 82 }
83 } 83 }
84 84
85 // Utility function to determine whether a token for the specified policy can 85 // Utility function to determine whether a token for the specified policy can
86 // be cached. 86 // be cached.
87 bool IsTokenCacheable(const sandbox::PolicyBase* policy) { 87 bool IsTokenCacheable(const sandbox::PolicyBase* policy) {
88 const sandbox::AppContainerAttributes* app_container = 88 const sandbox::AppContainerAttributes* app_container =
89 policy->GetAppContainer(); 89 policy->GetAppContainer();
90 90
91 // We cannot cache tokens with an app container. 91 // We cannot cache tokens with an app container or lowbox.
92 if (app_container) 92 if (app_container || policy->GetLowBoxSid())
93 return false; 93 return false;
94 94
95 return true; 95 return true;
96 } 96 }
97 97
98 // Utility function to pack token values into a key for the cache map. 98 // Utility function to pack token values into a key for the cache map.
99 uint32_t GenerateTokenCacheKey(const sandbox::PolicyBase* policy) { 99 uint32_t GenerateTokenCacheKey(const sandbox::PolicyBase* policy) {
100 const size_t kTokenShift = 3; 100 const size_t kTokenShift = 3;
101 uint32_t key; 101 uint32_t key;
102 102
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 return SBOX_ERROR_UNSUPPORTED; 590 return SBOX_ERROR_UNSUPPORTED;
591 591
592 base::string16 name = LookupAppContainer(sid); 592 base::string16 name = LookupAppContainer(sid);
593 if (name.empty()) 593 if (name.empty())
594 return SBOX_ERROR_INVALID_APP_CONTAINER; 594 return SBOX_ERROR_INVALID_APP_CONTAINER;
595 595
596 return DeleteAppContainer(sid); 596 return DeleteAppContainer(sid);
597 } 597 }
598 598
599 } // namespace sandbox 599 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698