[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [2/2](try 2)advapi: handle fully qualified account names for well
From: Alexandre Julliard <julliard () winehq ! org>
Date: 2009-03-30 15:50:24
Message-ID: 878wmnnh6n.fsf () wine ! dyndns ! org
[Download RAW message or body]
Aric Stewart <aric@codeweavers.com> writes:
> @@ -2667,11 +2669,23 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, \
> LPCWSTR lpAccountName, PSI }
>
> /* Check well known SIDs first */
> + if (strchrW(lpAccountName,'\\'))
> + {
> + lpAccountNamePtr = strrchrW(lpAccountName,'\\');
> + lpAccountNamePtr++;
> + lpDomainNamePtr = lpAccountName;
> + }
> + else
> + lpAccountNamePtr = lpAccountName;
>
> for (i = 0; i < (sizeof(ACCOUNT_SIDS) / sizeof(ACCOUNT_SIDS[0])); i++)
> {
> - if (!strcmpiW(lpAccountName, ACCOUNT_SIDS[i].account) ||
> - (ACCOUNT_SIDS[i].alias && !strcmpiW(lpAccountName, \
> ACCOUNT_SIDS[i].alias))) + /* check domain first */
> + if (lpDomainNamePtr && strncmpiW(lpDomainNamePtr, ACCOUNT_SIDS[i].domain, \
> strlenW(ACCOUNT_SIDS[i].domain))) + continue;
You always need to check that the next char is a terminator when using
functions like strncmpiW.
--
Alexandre Julliard
julliard@winehq.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic