advapi32: SetEntriesInAclW() should accept account name "CURRENT_USER".

Rob Shearman robertshearman at gmail.com
Tue Aug 18 08:44:03 CDT 2009


2009/8/16 Rein Klazes <wijn at online.nl>:
> @@ -3510,7 +3511,8 @@ 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 (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use))
> +            if ( strcmpW( pEntries[i].Trustee.ptstrName, CURRENT_USER ) &&

What will the memory pointed to by ppsid[i] be set to in this case?
Hint: whatever the memory was last used for, not the SID of the
current user which is what is desired.

> +                    !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;

-- 
Rob Shearman



More information about the wine-devel mailing list