mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-16 03:53:01 -05:00
SetEntriesInAcl returns its error code directly.
According to the MSDN documentation, that is. Why oh why? Everything _else_ leaves it in GetLastError(). [originally from svn r10094]
This commit is contained in:
parent
df328536a9
commit
9803b6acb0
@ -107,6 +107,7 @@ int make_private_security_descriptor(DWORD permissions,
|
|||||||
{
|
{
|
||||||
SID_IDENTIFIER_AUTHORITY nt_auth = SECURITY_NT_AUTHORITY;
|
SID_IDENTIFIER_AUTHORITY nt_auth = SECURITY_NT_AUTHORITY;
|
||||||
EXPLICIT_ACCESS ea[3];
|
EXPLICIT_ACCESS ea[3];
|
||||||
|
int acl_err;
|
||||||
int ret = FALSE;
|
int ret = FALSE;
|
||||||
|
|
||||||
*psd = NULL;
|
*psd = NULL;
|
||||||
@ -144,9 +145,10 @@ int make_private_security_descriptor(DWORD permissions,
|
|||||||
ea[2].Trustee.TrusteeForm = TRUSTEE_IS_SID;
|
ea[2].Trustee.TrusteeForm = TRUSTEE_IS_SID;
|
||||||
ea[2].Trustee.ptstrName = (LPTSTR)*networksid;
|
ea[2].Trustee.ptstrName = (LPTSTR)*networksid;
|
||||||
|
|
||||||
if (p_SetEntriesInAclA(3, ea, NULL, acl) != ERROR_SUCCESS || *acl == NULL) {
|
acl_err = p_SetEntriesInAclA(3, ea, NULL, acl);
|
||||||
|
if (acl_err != ERROR_SUCCESS || *acl == NULL) {
|
||||||
*error = dupprintf("unable to construct ACL: %s",
|
*error = dupprintf("unable to construct ACL: %s",
|
||||||
win_strerror(GetLastError()));
|
win_strerror(acl_err));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user