1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 09:12:24 +00:00

Put back in a missing dynamic-load wrapper on SetSecurityInfo.

We had inadvertently raised the minimum supported Windows version in
the course of restricting PuTTY's ACL.

(cherry picked from commit bf3621f247)
This commit is contained in:
Simon Tatham 2015-11-28 18:31:10 +00:00
parent 0d919e2124
commit a5634e0ccb
2 changed files with 8 additions and 10 deletions

View File

@ -27,6 +27,7 @@ int got_advapi(void)
advapi = load_system32_dll("advapi32.dll"); advapi = load_system32_dll("advapi32.dll");
successful = advapi && successful = advapi &&
GET_WINDOWS_FUNCTION(advapi, GetSecurityInfo) && GET_WINDOWS_FUNCTION(advapi, GetSecurityInfo) &&
GET_WINDOWS_FUNCTION(advapi, SetSecurityInfo) &&
GET_WINDOWS_FUNCTION(advapi, OpenProcessToken) && GET_WINDOWS_FUNCTION(advapi, OpenProcessToken) &&
GET_WINDOWS_FUNCTION(advapi, GetTokenInformation) && GET_WINDOWS_FUNCTION(advapi, GetTokenInformation) &&
GET_WINDOWS_FUNCTION(advapi, InitializeSecurityDescriptor) && GET_WINDOWS_FUNCTION(advapi, InitializeSecurityDescriptor) &&
@ -265,16 +266,10 @@ int setprocessacl(char *error)
goto cleanup; goto cleanup;
} }
if (ERROR_SUCCESS != if (ERROR_SUCCESS != p_SetSecurityInfo
SetSecurityInfo( (GetCurrentProcess(), SE_KERNEL_OBJECT,
GetCurrentProcess(), OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
SE_KERNEL_OBJECT, usersid, NULL, acl, NULL)) {
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
usersid,
NULL,
acl,
NULL
)) {
error=dupprintf("Unable to set process ACL: %s", error=dupprintf("Unable to set process ACL: %s",
win_strerror(GetLastError())); win_strerror(GetLastError()));
goto cleanup; goto cleanup;

View File

@ -28,6 +28,9 @@ DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, GetSecurityInfo,
(HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION, (HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION,
PSID *, PSID *, PACL *, PACL *, PSID *, PSID *, PACL *, PACL *,
PSECURITY_DESCRIPTOR *)); PSECURITY_DESCRIPTOR *));
DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, SetSecurityInfo,
(HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION,
PSID, PSID, PACL, PACL));
DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, SetEntriesInAclA, DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, SetEntriesInAclA,
(ULONG, PEXPLICIT_ACCESS, PACL, PACL *)); (ULONG, PEXPLICIT_ACCESS, PACL, PACL *));
int got_advapi(void); int got_advapi(void);