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
b46e2ef9
Commit
b46e2ef9
authored
Aug 16, 2009
by
Rein Klazes
Committed by
Alexandre Julliard
Aug 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: SetEntriesInAclW() should accept account name "CURRENT_USER".
parent
1ebbab8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
security.c
dlls/advapi32/security.c
+3
-1
security.c
dlls/advapi32/tests/security.c
+8
-0
No files found.
dlls/advapi32/security.c
View file @
b46e2ef9
...
...
@@ -184,6 +184,7 @@ static const WCHAR CREATOR_GROUP[] = { 'C','R','E','A','T','O','R',' ','G','R','
static
const
WCHAR
CREATOR_GROUP_SERVER
[]
=
{
'C'
,
'R'
,
'E'
,
'A'
,
'T'
,
'O'
,
'R'
,
' '
,
'G'
,
'R'
,
'O'
,
'U'
,
'P'
,
' '
,
'S'
,
'E'
,
'R'
,
'V'
,
'E'
,
'R'
,
0
};
static
const
WCHAR
CREATOR_OWNER
[]
=
{
'C'
,
'R'
,
'E'
,
'A'
,
'T'
,
'O'
,
'R'
,
' '
,
'O'
,
'W'
,
'N'
,
'E'
,
'R'
,
0
};
static
const
WCHAR
CREATOR_OWNER_SERVER
[]
=
{
'C'
,
'R'
,
'E'
,
'A'
,
'T'
,
'O'
,
'R'
,
' '
,
'O'
,
'W'
,
'N'
,
'E'
,
'R'
,
' '
,
'S'
,
'E'
,
'R'
,
'V'
,
'E'
,
'R'
,
0
};
static
const
WCHAR
CURRENT_USER
[]
=
{
'C'
,
'U'
,
'R'
,
'R'
,
'E'
,
'N'
,
'T'
,
'_'
,
'U'
,
'S'
,
'E'
,
'R'
,
0
};
static
const
WCHAR
DIALUP
[]
=
{
'D'
,
'I'
,
'A'
,
'L'
,
'U'
,
'P'
,
0
};
static
const
WCHAR
Digest_Authentication
[]
=
{
'D'
,
'i'
,
'g'
,
'e'
,
's'
,
't'
,
' '
,
'A'
,
'u'
,
't'
,
'h'
,
'e'
,
'n'
,
't'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
DOMAIN
[]
=
{
'D'
,
'O'
,
'M'
,
'A'
,
'I'
,
'N'
,
0
};
...
...
@@ -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
)
&&
!
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
;
...
...
dlls/advapi32/tests/security.c
View file @
b46e2ef9
...
...
@@ -2482,6 +2482,7 @@ static void test_SetEntriesInAcl(void)
SID_IDENTIFIER_AUTHORITY
SIDAuthNT
=
{
SECURITY_NT_AUTHORITY
};
EXPLICIT_ACCESSW
ExplicitAccess
;
static
const
WCHAR
wszEveryone
[]
=
{
'E'
,
'v'
,
'e'
,
'r'
,
'y'
,
'o'
,
'n'
,
'e'
,
0
};
static
const
WCHAR
wszCurrentUser
[]
=
{
'C'
,
'U'
,
'R'
,
'R'
,
'E'
,
'N'
,
'T'
,
'_'
,
'U'
,
'S'
,
'E'
,
'R'
,
'\0'
};
if
(
!
pSetEntriesInAclW
)
{
...
...
@@ -2575,6 +2576,13 @@ static void test_SetEntriesInAcl(void)
LocalFree
(
NewAcl
);
}
ExplicitAccess
.
Trustee
.
TrusteeForm
=
TRUSTEE_IS_USER
;
ExplicitAccess
.
Trustee
.
ptstrName
=
(
LPWSTR
)
wszCurrentUser
;
res
=
pSetEntriesInAclW
(
1
,
&
ExplicitAccess
,
OldAcl
,
&
NewAcl
);
ok
(
res
==
ERROR_SUCCESS
,
"SetEntriesInAclW failed: %u
\n
"
,
res
);
ok
(
NewAcl
!=
NULL
,
"returned acl was NULL
\n
"
);
LocalFree
(
NewAcl
);
ExplicitAccess
.
grfAccessMode
=
REVOKE_ACCESS
;
ExplicitAccess
.
Trustee
.
TrusteeForm
=
TRUSTEE_IS_SID
;
ExplicitAccess
.
Trustee
.
ptstrName
=
UsersSid
;
...
...
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