diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2018-01-01 00:49:25 +1100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-01-13 11:10:08 +0100 |
commit | 9acf3da78a5146c5af557967eabd0c47bf54d466 (patch) | |
tree | 6572419f556283d868ee2c751e6eeb4383dbf5da /sal/osl | |
parent | fa09d724b4c3309ce2961ad6b9cd11ade5753f33 (diff) |
sal: remove no longer needed CheckTokenMembership_Stub
CheckTokenMembership_Stub was added in commit ce20f0702 because there
was a problem with patching/replacing UWINAPI on Windows ME. To
resolve this, CheckTokenMembership was not exported to stay compatible
which is no longer an issue.
Change-Id: I654a5f5ececa918f844eca541942b9d552fcfa7f
Reviewed-on: https://gerrit.libreoffice.org/47217
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/w32/security.cxx | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/sal/osl/w32/security.cxx b/sal/osl/w32/security.cxx index 0c086cd5c7bf..986afc83412e 100644 --- a/sal/osl/w32/security.cxx +++ b/sal/osl/w32/security.cxx @@ -192,31 +192,6 @@ oslSecurityError SAL_CALL osl_loginUserOnFileServer(rtl_uString *strUserName, return ret; } -static BOOL WINAPI CheckTokenMembership_Stub( HANDLE TokenHandle, PSID SidToCheck, PBOOL IsMember ) -{ - typedef BOOL (WINAPI *CheckTokenMembership_PROC)( HANDLE, PSID, PBOOL ); - - static HMODULE hModule = nullptr; - static CheckTokenMembership_PROC pCheckTokenMembership = nullptr; - - if ( !hModule ) - { - /* SAL is always linked against ADVAPI32 so we can rely on that it is already mapped */ - hModule = GetModuleHandleW( L"ADVAPI32.DLL" ); - - pCheckTokenMembership = reinterpret_cast<CheckTokenMembership_PROC>(GetProcAddress( hModule, "CheckTokenMembership" )); - } - - if ( pCheckTokenMembership ) - return pCheckTokenMembership( TokenHandle, SidToCheck, IsMember ); - else - { - SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return FALSE; - } - -} - sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security) { if (Security != nullptr) @@ -245,21 +220,21 @@ sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security) if (AllocateAndInitializeSid(&siaNtAuthority, 2, - SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, - &psidAdministrators)) + SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_ADMINS, + 0, 0, 0, 0, 0, 0, + &psidAdministrators)) { - BOOL fSuccess = FALSE; + BOOL fSuccess = FALSE; - if ( CheckTokenMembership_Stub( hImpersonationToken, psidAdministrators, &fSuccess ) && fSuccess ) + if (CheckTokenMembership(hImpersonationToken, psidAdministrators, &fSuccess) && fSuccess) bSuccess = true; FreeSid(psidAdministrators); } - if ( hImpersonationToken ) - CloseHandle( hImpersonationToken ); + if (hImpersonationToken) + CloseHandle(hImpersonationToken); return bSuccess; } |