mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +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:
parent
0d919e2124
commit
a5634e0ccb
@ -27,6 +27,7 @@ int got_advapi(void)
|
||||
advapi = load_system32_dll("advapi32.dll");
|
||||
successful = advapi &&
|
||||
GET_WINDOWS_FUNCTION(advapi, GetSecurityInfo) &&
|
||||
GET_WINDOWS_FUNCTION(advapi, SetSecurityInfo) &&
|
||||
GET_WINDOWS_FUNCTION(advapi, OpenProcessToken) &&
|
||||
GET_WINDOWS_FUNCTION(advapi, GetTokenInformation) &&
|
||||
GET_WINDOWS_FUNCTION(advapi, InitializeSecurityDescriptor) &&
|
||||
@ -265,16 +266,10 @@ int setprocessacl(char *error)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (ERROR_SUCCESS !=
|
||||
SetSecurityInfo(
|
||||
GetCurrentProcess(),
|
||||
SE_KERNEL_OBJECT,
|
||||
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
|
||||
usersid,
|
||||
NULL,
|
||||
acl,
|
||||
NULL
|
||||
)) {
|
||||
if (ERROR_SUCCESS != p_SetSecurityInfo
|
||||
(GetCurrentProcess(), SE_KERNEL_OBJECT,
|
||||
OWNER_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
|
||||
usersid, NULL, acl, NULL)) {
|
||||
error=dupprintf("Unable to set process ACL: %s",
|
||||
win_strerror(GetLastError()));
|
||||
goto cleanup;
|
||||
|
@ -28,6 +28,9 @@ DECL_WINDOWS_FUNCTION(WINSECUR_GLOBAL, DWORD, GetSecurityInfo,
|
||||
(HANDLE, SE_OBJECT_TYPE, SECURITY_INFORMATION,
|
||||
PSID *, PSID *, PACL *, PACL *,
|
||||
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,
|
||||
(ULONG, PEXPLICIT_ACCESS, PACL, PACL *));
|
||||
int got_advapi(void);
|
||||
|
Loading…
Reference in New Issue
Block a user