Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1d03ba76
Commit
1d03ba76
authored
Nov 17, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix parsing empty DACL/SACL security descriptor strings.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f9475469
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
security.c
dlls/advapi32/security.c
+2
-2
security.c
dlls/advapi32/tests/security.c
+29
-0
No files found.
dlls/advapi32/security.c
View file @
1d03ba76
...
...
@@ -4314,7 +4314,7 @@ static DWORD ParseAclStringFlags(LPCWSTR* StringAcl)
DWORD
flags
=
0
;
LPCWSTR
szAcl
=
*
StringAcl
;
while
(
*
szAcl
!=
'('
)
while
(
*
szAcl
&&
*
szAcl
!=
'('
)
{
if
(
*
szAcl
==
'P'
)
{
...
...
@@ -4625,7 +4625,7 @@ static BOOL ParseStringAclToAcl(LPCWSTR StringAcl, LPDWORD lpdwFlags,
pAcl
->
AclRevision
=
ACL_REVISION
;
pAcl
->
Sbz1
=
0
;
pAcl
->
AclSize
=
length
;
pAcl
->
AceCount
=
acecount
++
;
pAcl
->
AceCount
=
acecount
;
pAcl
->
Sbz2
=
0
;
}
return
TRUE
;
...
...
dlls/advapi32/tests/security.c
View file @
1d03ba76
...
...
@@ -4101,6 +4101,8 @@ static void test_ConvertStringSecurityDescriptor(void)
PSECURITY_DESCRIPTOR
pSD
;
static
const
WCHAR
Blank
[]
=
{
0
};
unsigned
int
i
;
ULONG
size
;
ACL
*
acl
;
static
const
struct
{
const
char
*
sidstring
;
...
...
@@ -4211,6 +4213,33 @@ static void test_ConvertStringSecurityDescriptor(void)
ok
(
ret
||
broken
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_DATATYPE
)
/* win2k */
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %u
\n
"
,
GetLastError
());
if
(
ret
)
LocalFree
(
pSD
);
/* empty DACL */
size
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:"
,
SDDL_REVISION_1
,
&
pSD
,
&
size
);
ok
(
ret
,
"unexpected error %u
\n
"
,
GetLastError
());
ok
(
size
==
sizeof
(
SECURITY_DESCRIPTOR_RELATIVE
)
+
sizeof
(
ACL
),
"got %u
\n
"
,
size
);
acl
=
(
ACL
*
)((
char
*
)
pSD
+
sizeof
(
SECURITY_DESCRIPTOR_RELATIVE
));
ok
(
acl
->
AclRevision
==
ACL_REVISION
,
"got %u
\n
"
,
acl
->
AclRevision
);
ok
(
!
acl
->
Sbz1
,
"got %u
\n
"
,
acl
->
Sbz1
);
ok
(
acl
->
AclSize
==
sizeof
(
*
acl
),
"got %u
\n
"
,
acl
->
AclSize
);
ok
(
!
acl
->
AceCount
,
"got %u
\n
"
,
acl
->
AceCount
);
ok
(
!
acl
->
Sbz2
,
"got %u
\n
"
,
acl
->
Sbz2
);
LocalFree
(
pSD
);
/* empty SACL */
size
=
0
;
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"S:"
,
SDDL_REVISION_1
,
&
pSD
,
&
size
);
ok
(
ret
,
"unexpected error %u
\n
"
,
GetLastError
());
ok
(
size
==
sizeof
(
SECURITY_DESCRIPTOR_RELATIVE
)
+
sizeof
(
ACL
),
"got %u
\n
"
,
size
);
acl
=
(
ACL
*
)((
char
*
)
pSD
+
sizeof
(
SECURITY_DESCRIPTOR_RELATIVE
));
ok
(
!
acl
->
Sbz1
,
"got %u
\n
"
,
acl
->
Sbz1
);
ok
(
acl
->
AclSize
==
sizeof
(
*
acl
),
"got %u
\n
"
,
acl
->
AclSize
);
ok
(
!
acl
->
AceCount
,
"got %u
\n
"
,
acl
->
AceCount
);
ok
(
!
acl
->
Sbz2
,
"got %u
\n
"
,
acl
->
Sbz2
);
LocalFree
(
pSD
);
}
static
void
test_ConvertSecurityDescriptorToString
(
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