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

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

Issue 1814863004: Cleanup/Remove Windows XP/Vista version checks from Windows sandbox code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert disabled reparse point check Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/win/src/registry_dispatcher.cc ('k') | sandbox/win/src/sandbox_policy_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/restricted_token_utils.cc
diff --git a/sandbox/win/src/restricted_token_utils.cc b/sandbox/win/src/restricted_token_utils.cc
index 4a3d05c639bcd5acbfff79ce2a96df946fc56ce7..9a06223324401d879c1822958e70587b66b2b836 100644
--- a/sandbox/win/src/restricted_token_utils.cc
+++ b/sandbox/win/src/restricted_token_utils.cc
@@ -78,12 +78,11 @@ DWORD CreateRestrictedToken(TokenLevel security_level,
restricted_token.AddRestrictingSid(WinRestrictedCodeSid);
// This token has to be able to create objects in BNO.
- // Unfortunately, on vista, it needs the current logon sid
+ // Unfortunately, on Vista+, it needs the current logon sid
// in the token to achieve this. You should also set the process to be
// low integrity level so it can't access object created by other
// processes.
- if (base::win::GetVersion() >= base::win::VERSION_VISTA)
- restricted_token.AddRestrictingSidLogonSession();
+ restricted_token.AddRestrictingSidLogonSession();
break;
}
case USER_RESTRICTED: {
@@ -198,8 +197,6 @@ const wchar_t* GetIntegrityLevelString(IntegrityLevel integrity_level) {
return NULL;
}
DWORD SetTokenIntegrityLevel(HANDLE token, IntegrityLevel integrity_level) {
- if (base::win::GetVersion() < base::win::VERSION_VISTA)
- return ERROR_SUCCESS;
const wchar_t* integrity_level_str = GetIntegrityLevelString(integrity_level);
if (!integrity_level_str) {
@@ -225,8 +222,6 @@ DWORD SetTokenIntegrityLevel(HANDLE token, IntegrityLevel integrity_level) {
}
DWORD SetProcessIntegrityLevel(IntegrityLevel integrity_level) {
- if (base::win::GetVersion() < base::win::VERSION_VISTA)
- return ERROR_SUCCESS;
// We don't check for an invalid level here because we'll just let it
// fail on the SetTokenIntegrityLevel call later on.
@@ -246,8 +241,6 @@ DWORD SetProcessIntegrityLevel(IntegrityLevel integrity_level) {
}
DWORD HardenTokenIntegrityLevelPolicy(HANDLE token) {
- if (base::win::GetVersion() < base::win::VERSION_WIN7)
- return ERROR_SUCCESS;
DWORD last_error = 0;
DWORD length_needed = 0;
@@ -295,8 +288,6 @@ DWORD HardenTokenIntegrityLevelPolicy(HANDLE token) {
}
DWORD HardenProcessIntegrityLevelPolicy() {
- if (base::win::GetVersion() < base::win::VERSION_WIN7)
- return ERROR_SUCCESS;
HANDLE token_handle;
if (!::OpenProcessToken(GetCurrentProcess(), READ_CONTROL | WRITE_OWNER,
« no previous file with comments | « sandbox/win/src/registry_dispatcher.cc ('k') | sandbox/win/src/sandbox_policy_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698