| 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,
|
|
|