Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
9d9a684e
Commit
9d9a684e
authored
Mar 31, 2009
by
Aric Stewart
Committed by
Alexandre Julliard
Apr 01, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Handle fully qualified account names for well known sids in LookupAccountName.
parent
b540d57c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
security.c
dlls/advapi32/security.c
+15
-2
security.c
dlls/advapi32/tests/security.c
+7
-0
No files found.
dlls/advapi32/security.c
View file @
9d9a684e
...
...
@@ -2651,6 +2651,8 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
DWORD
nameLen
;
LPWSTR
userName
=
NULL
;
LPCWSTR
domainName
;
LPCWSTR
lpAccountNamePtr
;
LPCWSTR
lpDomainNamePtr
=
NULL
;
FIXME
(
"%s %s %p %p %p %p %p - stub
\n
"
,
debugstr_w
(
lpSystemName
),
debugstr_w
(
lpAccountName
),
Sid
,
cbSid
,
ReferencedDomainName
,
cchReferencedDomainName
,
peUse
);
...
...
@@ -2667,11 +2669,22 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
}
/* Check well known SIDs first */
if
((
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
))
||
lpDomainNamePtr
[
strlenW
(
ACCOUNT_SIDS
[
i
].
domain
)]
!=
'\\'
))
continue
;
if
(
!
strcmpiW
(
lpAccountNamePtr
,
ACCOUNT_SIDS
[
i
].
account
)
||
(
ACCOUNT_SIDS
[
i
].
alias
&&
!
strcmpiW
(
lpAccountNamePtr
,
ACCOUNT_SIDS
[
i
].
alias
)))
{
DWORD
sidLen
=
SECURITY_MAX_SID_SIZE
;
...
...
dlls/advapi32/tests/security.c
View file @
9d9a684e
...
...
@@ -1982,6 +1982,13 @@ static void test_LookupAccountName(void)
/* case insensitivity */
check_wellknown_name
(
"lOCAlServICE"
,
WinLocalServiceSid
);
/* fully qualified account names */
check_wellknown_name
(
"NT AUTHORITY
\\
LocalService"
,
WinLocalServiceSid
);
check_wellknown_name
(
"nt authority
\\
Network Service"
,
WinNetworkServiceSid
);
check_wellknown_name
(
"nt authority test
\\
Network Service"
,
0
);
check_wellknown_name
(
"Dummy
\\
Network Service"
,
0
);
check_wellknown_name
(
"ntauthority
\\
Network Service"
,
0
);
}
static
void
test_security_descriptor
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment