Kaydet (Commit) 9acf3da7 authored tarafından Chris Sherlock's avatar Chris Sherlock Kaydeden (comit) Thorsten Behrens

sal: remove no longer needed CheckTokenMembership_Stub

CheckTokenMembership_Stub was added in commit ce20f070 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/47217Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst fa09d724
...@@ -192,31 +192,6 @@ oslSecurityError SAL_CALL osl_loginUserOnFileServer(rtl_uString *strUserName, ...@@ -192,31 +192,6 @@ oslSecurityError SAL_CALL osl_loginUserOnFileServer(rtl_uString *strUserName,
return ret; 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) sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security)
{ {
if (Security != nullptr) if (Security != nullptr)
...@@ -245,21 +220,21 @@ sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security) ...@@ -245,21 +220,21 @@ sal_Bool SAL_CALL osl_isAdministrator(oslSecurity Security)
if (AllocateAndInitializeSid(&siaNtAuthority, if (AllocateAndInitializeSid(&siaNtAuthority,
2, 2,
SECURITY_BUILTIN_DOMAIN_RID, SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS, DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
&psidAdministrators)) &psidAdministrators))
{ {
BOOL fSuccess = FALSE; BOOL fSuccess = FALSE;
if ( CheckTokenMembership_Stub( hImpersonationToken, psidAdministrators, &fSuccess ) && fSuccess ) if (CheckTokenMembership(hImpersonationToken, psidAdministrators, &fSuccess) && fSuccess)
bSuccess = true; bSuccess = true;
FreeSid(psidAdministrators); FreeSid(psidAdministrators);
} }
if ( hImpersonationToken ) if (hImpersonationToken)
CloseHandle( hImpersonationToken ); CloseHandle(hImpersonationToken);
return bSuccess; return bSuccess;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment