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
f3b4e169
Commit
f3b4e169
authored
Jun 11, 2021
by
Esme Povirk
Committed by
Alexandre Julliard
Jun 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sechost: SID strings are case-insensitive.
Signed-off-by:
Esme Povirk
<
esme@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9032eeec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
security.c
dlls/advapi32/tests/security.c
+2
-0
security.c
dlls/sechost/security.c
+6
-6
No files found.
dlls/advapi32/tests/security.c
View file @
f3b4e169
...
...
@@ -265,6 +265,7 @@ static void test_ConvertStringSidToSid(void)
str_to_sid_tests
[]
=
{
{
"WD"
,
"S-1-1-0"
},
{
"wD"
,
"S-1-1-0"
},
{
"CO"
,
"S-1-3-0"
},
{
"CG"
,
"S-1-3-1"
},
{
"OW"
,
"S-1-3-4"
,
1
},
/* Vista+ */
...
...
@@ -304,6 +305,7 @@ static void test_ConvertStringSidToSid(void)
{
"PA"
,
""
,
1
},
{
"RS"
,
""
,
1
},
{
"SA"
,
""
,
1
},
{
"s-1-12-1"
,
"S-1-12-1"
},
};
const
char
noSubAuthStr
[]
=
"S-1-5"
;
...
...
dlls/sechost/security.c
View file @
f3b4e169
...
...
@@ -596,7 +596,7 @@ static BOOL get_computer_sid( PSID sid )
static
DWORD
get_sid_size
(
const
WCHAR
*
string
,
const
WCHAR
**
end
)
{
if
(
string
[
0
]
==
'S'
&&
string
[
1
]
==
'-'
)
/* S-R-I(-S)+ */
if
(
(
string
[
0
]
==
'S'
||
string
[
0
]
==
's'
)
&&
string
[
1
]
==
'-'
)
/* S-R-I(-S)+ */
{
int
token_count
=
0
;
string
++
;
...
...
@@ -622,13 +622,13 @@ static DWORD get_sid_size( const WCHAR *string, const WCHAR **end )
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
well_known_sids
);
i
++
)
{
if
(
!
wcsncmp
(
well_known_sids
[
i
].
str
,
string
,
2
))
if
(
!
wcsn
i
cmp
(
well_known_sids
[
i
].
str
,
string
,
2
))
return
GetSidLengthRequired
(
well_known_sids
[
i
].
sid
.
SubAuthorityCount
);
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
well_known_rids
);
i
++
)
{
if
(
!
wcsncmp
(
well_known_rids
[
i
].
str
,
string
,
2
))
if
(
!
wcsn
i
cmp
(
well_known_rids
[
i
].
str
,
string
,
2
))
{
struct
max_sid
local
;
get_computer_sid
(
&
local
);
...
...
@@ -649,7 +649,7 @@ static BOOL parse_sid( const WCHAR *string, const WCHAR **end, SID *pisid, DWORD
if
(
!
pisid
)
/* Simply compute the size */
return
TRUE
;
if
(
string
[
0
]
==
'S'
&&
string
[
1
]
==
'-'
)
/* S-R-I-S-S */
if
(
(
string
[
0
]
==
'S'
||
string
[
0
]
==
's'
)
&&
string
[
1
]
==
'-'
)
/* S-R-I-S-S */
{
DWORD
i
=
0
,
identAuth
;
DWORD
csubauth
=
((
*
size
-
GetSidLengthRequired
(
0
))
/
sizeof
(
DWORD
));
...
...
@@ -717,7 +717,7 @@ static BOOL parse_sid( const WCHAR *string, const WCHAR **end, SID *pisid, DWORD
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
well_known_sids
);
i
++
)
{
if
(
!
wcsncmp
(
well_known_sids
[
i
].
str
,
string
,
2
))
if
(
!
wcsn
i
cmp
(
well_known_sids
[
i
].
str
,
string
,
2
))
{
DWORD
j
;
pisid
->
SubAuthorityCount
=
well_known_sids
[
i
].
sid
.
SubAuthorityCount
;
...
...
@@ -730,7 +730,7 @@ static BOOL parse_sid( const WCHAR *string, const WCHAR **end, SID *pisid, DWORD
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
well_known_rids
);
i
++
)
{
if
(
!
wcsncmp
(
well_known_rids
[
i
].
str
,
string
,
2
))
if
(
!
wcsn
i
cmp
(
well_known_rids
[
i
].
str
,
string
,
2
))
{
get_computer_sid
(
pisid
);
pisid
->
SubAuthority
[
pisid
->
SubAuthorityCount
]
=
well_known_rids
[
i
].
rid
;
...
...
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