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
dacc3dbf
Commit
dacc3dbf
authored
Jun 14, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix size used to validate the sids in aces.
parent
acaa5c5e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
token.c
server/token.c
+7
-2
trace.c
server/trace.c
+14
-3
No files found.
server/token.c
View file @
dacc3dbf
...
...
@@ -161,6 +161,7 @@ static int acl_is_valid( const ACL *acl, size_t size )
for
(
i
=
0
;
i
<
acl
->
AceCount
;
i
++
)
{
const
SID
*
sid
;
size_t
sid_size
;
if
(
size
<
sizeof
(
ACE_HEADER
))
return
FALSE
;
...
...
@@ -171,21 +172,25 @@ static int acl_is_valid( const ACL *acl, size_t size )
{
case
ACCESS_DENIED_ACE_TYPE
:
sid
=
(
const
SID
*
)
&
((
const
ACCESS_DENIED_ACE
*
)
ace
)
->
SidStart
;
sid_size
=
ace
->
AceSize
-
FIELD_OFFSET
(
ACCESS_DENIED_ACE
,
SidStart
);
break
;
case
ACCESS_ALLOWED_ACE_TYPE
:
sid
=
(
const
SID
*
)
&
((
const
ACCESS_ALLOWED_ACE
*
)
ace
)
->
SidStart
;
sid_size
=
ace
->
AceSize
-
FIELD_OFFSET
(
ACCESS_ALLOWED_ACE
,
SidStart
);
break
;
case
SYSTEM_AUDIT_ACE_TYPE
:
sid
=
(
const
SID
*
)
&
((
const
SYSTEM_AUDIT_ACE
*
)
ace
)
->
SidStart
;
sid_size
=
ace
->
AceSize
-
FIELD_OFFSET
(
SYSTEM_AUDIT_ACE
,
SidStart
);
break
;
case
SYSTEM_ALARM_ACE_TYPE
:
sid
=
(
const
SID
*
)
&
((
const
SYSTEM_ALARM_ACE
*
)
ace
)
->
SidStart
;
sid_size
=
ace
->
AceSize
-
FIELD_OFFSET
(
SYSTEM_ALARM_ACE
,
SidStart
);
break
;
default:
return
FALSE
;
}
if
(
si
ze
<
sizeof
(
SID
)
||
size
<
FIELD_OFFSET
(
SID
,
SubAuthority
[
sid
->
SubAuthorityCount
]))
if
(
si
d_size
<
FIELD_OFFSET
(
SID
,
SubAuthority
[
0
]
)
||
si
d_si
ze
<
FIELD_OFFSET
(
SID
,
SubAuthority
[
sid
->
SubAuthorityCount
]))
return
FALSE
;
ace
=
ace_next
(
ace
);
}
...
...
server/trace.c
View file @
dacc3dbf
...
...
@@ -429,9 +429,12 @@ static void dump_inline_sid( const SID *sid, size_t size )
DWORD
i
;
/* security check */
if
((
size
<
sizeof
(
SID
))
||
(
FIELD_OFFSET
(
SID
,
SubAuthority
[
sid
->
SubAuthorityCount
])
>
size
))
if
((
FIELD_OFFSET
(
SID
,
SubAuthority
[
0
])
>
size
)
||
(
FIELD_OFFSET
(
SID
,
SubAuthority
[
sid
->
SubAuthorityCount
])
>
size
))
{
fprintf
(
stderr
,
"<invalid sid>"
);
return
;
}
fputc
(
'{'
,
stderr
);
fprintf
(
stderr
,
"S-%u-%lu"
,
sid
->
Revision
,
MAKELONG
(
...
...
@@ -453,12 +456,16 @@ static void dump_inline_acl( const ACL *acl, size_t size )
if
(
size
)
{
if
(
size
<
sizeof
(
ACL
))
{
fprintf
(
stderr
,
"<invalid acl>}
\n
"
);
return
;
}
size
-=
sizeof
(
ACL
);
ace
=
(
const
ACE_HEADER
*
)(
acl
+
1
);
for
(
i
=
0
;
i
<
acl
->
AceCount
;
i
++
)
{
const
SID
*
sid
=
NULL
;
size_t
sid_size
=
0
;
if
(
size
<
sizeof
(
ACE_HEADER
))
return
;
...
...
@@ -471,21 +478,25 @@ static void dump_inline_acl( const ACL *acl, size_t size )
{
case
ACCESS_DENIED_ACE_TYPE
:
sid
=
(
const
SID
*
)
&
((
const
ACCESS_DENIED_ACE
*
)
ace
)
->
SidStart
;
sid_size
=
ace
->
AceSize
-
FIELD_OFFSET
(
ACCESS_DENIED_ACE
,
SidStart
);
fprintf
(
stderr
,
"ACCESS_DENIED_ACE_TYPE,Mask=%lx"
,
((
const
ACCESS_DENIED_ACE
*
)
ace
)
->
Mask
);
break
;
case
ACCESS_ALLOWED_ACE_TYPE
:
sid
=
(
const
SID
*
)
&
((
const
ACCESS_ALLOWED_ACE
*
)
ace
)
->
SidStart
;
sid_size
=
ace
->
AceSize
-
FIELD_OFFSET
(
ACCESS_ALLOWED_ACE
,
SidStart
);
fprintf
(
stderr
,
"ACCESS_ALLOWED_ACE_TYPE,Mask=%lx"
,
((
const
ACCESS_ALLOWED_ACE
*
)
ace
)
->
Mask
);
break
;
case
SYSTEM_AUDIT_ACE_TYPE
:
sid
=
(
const
SID
*
)
&
((
const
SYSTEM_AUDIT_ACE
*
)
ace
)
->
SidStart
;
sid_size
=
ace
->
AceSize
-
FIELD_OFFSET
(
SYSTEM_AUDIT_ACE
,
SidStart
);
fprintf
(
stderr
,
"SYSTEM_AUDIT_ACE_TYPE,Mask=%lx"
,
((
const
SYSTEM_AUDIT_ACE
*
)
ace
)
->
Mask
);
break
;
case
SYSTEM_ALARM_ACE_TYPE
:
sid
=
(
const
SID
*
)
&
((
const
SYSTEM_ALARM_ACE
*
)
ace
)
->
SidStart
;
sid_size
=
ace
->
AceSize
-
FIELD_OFFSET
(
SYSTEM_ALARM_ACE
,
SidStart
);
fprintf
(
stderr
,
"SYSTEM_ALARM_ACE_TYPE,Mask=%lx"
,
((
const
SYSTEM_ALARM_ACE
*
)
ace
)
->
Mask
);
break
;
...
...
@@ -495,7 +506,7 @@ static void dump_inline_acl( const ACL *acl, size_t size )
}
fprintf
(
stderr
,
",AceFlags=%x,Sid="
,
ace
->
AceFlags
);
if
(
sid
)
dump_inline_sid
(
sid
,
size
);
dump_inline_sid
(
sid
,
si
d_si
ze
);
ace
=
(
const
ACE_HEADER
*
)((
const
char
*
)
ace
+
ace
->
AceSize
);
fputc
(
'}'
,
stderr
);
}
...
...
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