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
bb3d74c2
Commit
bb3d74c2
authored
May 11, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
May 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sechost: Allow hexadecimal and string rights flags to be interleaved.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c74508d2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
21 deletions
+13
-21
security.c
dlls/advapi32/tests/security.c
+4
-0
security.c
dlls/sechost/security.c
+9
-21
No files found.
dlls/advapi32/tests/security.c
View file @
bb3d74c2
...
@@ -4212,6 +4212,10 @@ static void test_ConvertStringSecurityDescriptor(void)
...
@@ -4212,6 +4212,10 @@ static void test_ConvertStringSecurityDescriptor(void)
{
"D:(A;;KAKRKWKX;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"D:(A;;KAKRKWKX;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"D:(A;;0xFFFFFFFF;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"D:(A;;0xFFFFFFFF;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"S:(AU;;0xFFFFFFFF;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"S:(AU;;0xFFFFFFFF;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"S:(AU;;0xDeAdBeEf;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"S:(AU;;GR0xFFFFFFFF;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"S:(AU;;0xFFFFFFFFGR;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
{
"S:(AU;;0xFFFFFGR;;;WD)"
,
SDDL_REVISION_1
,
TRUE
},
/* test ACE string access right error case */
/* test ACE string access right error case */
{
"D:(A;;ROB;;;WD)"
,
SDDL_REVISION_1
,
FALSE
,
ERROR_INVALID_ACL
},
{
"D:(A;;ROB;;;WD)"
,
SDDL_REVISION_1
,
FALSE
,
ERROR_INVALID_ACL
},
/* test behaviour with empty strings */
/* test behaviour with empty strings */
...
...
dlls/sechost/security.c
View file @
bb3d74c2
...
@@ -868,15 +868,22 @@ static DWORD parse_ace_flag( const WCHAR *string )
...
@@ -868,15 +868,22 @@ static DWORD parse_ace_flag( const WCHAR *string )
return
0
;
return
0
;
}
}
static
DWORD
parse_ace_right
(
const
WCHAR
*
string
)
static
DWORD
parse_ace_right
(
const
WCHAR
*
*
string_ptr
)
{
{
const
WCHAR
*
string
=
*
string_ptr
;
unsigned
int
i
;
unsigned
int
i
;
if
(
string
[
0
]
==
'0'
&&
string
[
1
]
==
'x'
)
return
wcstoul
(
string
,
(
WCHAR
**
)
string_ptr
,
16
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ace_rights
);
++
i
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ace_rights
);
++
i
)
{
{
if
(
!
wcsncmp
(
string
,
ace_rights
[
i
].
str
,
2
))
if
(
!
wcsncmp
(
string
,
ace_rights
[
i
].
str
,
2
))
{
*
string_ptr
+=
2
;
return
ace_rights
[
i
].
value
;
return
ace_rights
[
i
].
value
;
}
}
}
return
0
;
return
0
;
}
}
...
@@ -908,30 +915,11 @@ static DWORD parse_ace_rights( const WCHAR **string_ptr )
...
@@ -908,30 +915,11 @@ static DWORD parse_ace_rights( const WCHAR **string_ptr )
while
(
*
string
==
' '
)
while
(
*
string
==
' '
)
string
++
;
string
++
;
if
(
string
[
0
]
==
'0'
&&
string
[
1
]
==
'x'
)
{
const
WCHAR
*
p
=
string
;
while
(
*
p
&&
*
p
!=
';'
)
p
++
;
if
(
p
-
string
<=
10
/* 8 hex digits + "0x" */
)
{
rights
=
wcstoul
(
string
,
NULL
,
16
);
string
=
p
;
}
else
WARN
(
"Invalid rights string format: %s
\n
"
,
debugstr_wn
(
string
,
p
-
string
));
}
else
{
while
(
*
string
!=
';'
)
while
(
*
string
!=
';'
)
{
{
DWORD
right
=
parse_ace_right
(
string
);
DWORD
right
=
parse_ace_right
(
&
string
);
if
(
!
right
)
return
0
;
if
(
!
right
)
return
0
;
rights
|=
right
;
rights
|=
right
;
string
+=
2
;
}
}
}
*
string_ptr
=
string
;
*
string_ptr
=
string
;
...
...
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