]> asedeno.scripts.mit.edu Git - PuTTY_svn.git/commitdiff
SetEntriesInAcl returns its error code directly.
authorSimon Tatham <anakin@pobox.com>
Fri, 22 Nov 2013 19:41:49 +0000 (19:41 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 22 Nov 2013 19:41:49 +0000 (19:41 +0000)
According to the MSDN documentation, that is. Why oh why? Everything
_else_ leaves it in GetLastError().

git-svn-id: http://svn.tartarus.org/sgt/putty@10094 cda61777-01e9-0310-a592-d414129be87e

windows/winsecur.c

index f5eee440e74deac446de03784f30ef9889aab58f..27f04dd59e1c4da05796428205141c6c2257aa02 100644 (file)
@@ -107,6 +107,7 @@ int make_private_security_descriptor(DWORD permissions,
 {
     SID_IDENTIFIER_AUTHORITY nt_auth = SECURITY_NT_AUTHORITY;
     EXPLICIT_ACCESS ea[3];
+    int acl_err;
     int ret = FALSE;
 
     *psd = NULL;
@@ -144,9 +145,10 @@ int make_private_security_descriptor(DWORD permissions,
     ea[2].Trustee.TrusteeForm = TRUSTEE_IS_SID;
     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",
-                           win_strerror(GetLastError()));
+                           win_strerror(acl_err));
         goto cleanup;
     }