Alexandre Julliard : advapi32: Fix lookup of the current user SID in SetEntriesInAclW.

Alexandre Julliard julliard at winehq.org
Thu Oct 22 10:39:56 CDT 2009


Module: wine
Branch: master
Commit: 104a0f5439c941c5a052de28c40fd6613cdf99c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=104a0f5439c941c5a052de28c40fd6613cdf99c1

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Oct 22 13:19:31 2009 +0200

advapi32: Fix lookup of the current user SID in SetEntriesInAclW.

---

 dlls/advapi32/security.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index f89c12f..ba90ad0 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -3507,8 +3507,15 @@ DWORD WINAPI SetEntriesInAclW( ULONG count, PEXPLICIT_ACCESSW pEntries,
             DWORD sid_size = FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]);
             DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1;
             SID_NAME_USE use;
-            if ( strcmpW( pEntries[i].Trustee.ptstrName, CURRENT_USER ) &&
-                 !LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use))
+            if (!strcmpW( pEntries[i].Trustee.ptstrName, CURRENT_USER ))
+            {
+                if (!lookup_user_account_name( ppsid[i], &sid_size, NULL, &domain_size, &use ))
+                {
+                    ret = GetLastError();
+                    goto exit;
+                }
+            }
+            else if (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use))
             {
                 WARN("bad user name %s for trustee %d\n", debugstr_w(pEntries[i].Trustee.ptstrName), i);
                 ret = ERROR_INVALID_PARAMETER;




More information about the wine-cvs mailing list