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
b4926e27
Commit
b4926e27
authored
Oct 15, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Oct 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Respect object type in GetSecurityInfo().
Do not try to treat types which are not kernel handles as kernel handles.
parent
39802508
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
security.c
dlls/advapi32/security.c
+16
-5
No files found.
dlls/advapi32/security.c
View file @
b4926e27
...
@@ -1497,6 +1497,10 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
...
@@ -1497,6 +1497,10 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
NTSTATUS
status
;
NTSTATUS
status
;
ULONG
size
;
ULONG
size
;
BOOL
present
,
defaulted
;
BOOL
present
,
defaulted
;
HKEY
key
=
NULL
;
if
(
!
handle
)
return
ERROR_INVALID_HANDLE
;
/* A NULL descriptor is allowed if any one of the other pointers is not NULL */
/* A NULL descriptor is allowed if any one of the other pointers is not NULL */
if
(
!
(
ppsidOwner
||
ppsidGroup
||
ppDacl
||
ppSacl
||
ppSecurityDescriptor
))
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
ppsidOwner
||
ppsidGroup
||
ppDacl
||
ppSacl
||
ppSecurityDescriptor
))
return
ERROR_INVALID_PARAMETER
;
...
@@ -1509,8 +1513,9 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
...
@@ -1509,8 +1513,9 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
||
((
SecurityInfo
&
SACL_SECURITY_INFORMATION
)
&&
!
ppSacl
)
))
||
((
SecurityInfo
&
SACL_SECURITY_INFORMATION
)
&&
!
ppSacl
)
))
return
ERROR_INVALID_PARAMETER
;
return
ERROR_INVALID_PARAMETER
;
if
(
type
==
SE_SERVICE
)
switch
(
type
)
{
{
case
SE_SERVICE
:
if
(
!
QueryServiceObjectSecurity
(
handle
,
SecurityInfo
,
NULL
,
0
,
&
size
)
if
(
!
QueryServiceObjectSecurity
(
handle
,
SecurityInfo
,
NULL
,
0
,
&
size
)
&&
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
&&
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
return
GetLastError
();
return
GetLastError
();
...
@@ -1522,11 +1527,12 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
...
@@ -1522,11 +1527,12 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
LocalFree
(
sd
);
LocalFree
(
sd
);
return
GetLastError
();
return
GetLastError
();
}
}
}
break
;
else
{
HKEY
key
=
NULL
;
case
SE_KERNEL_OBJECT
:
case
SE_FILE_OBJECT
:
case
SE_WMIGUID_OBJECT
:
case
SE_REGISTRY_KEY
:
if
(
type
==
SE_REGISTRY_KEY
&&
(
HandleToUlong
(
handle
)
>=
HandleToUlong
(
HKEY_SPECIAL_ROOT_FIRST
))
if
(
type
==
SE_REGISTRY_KEY
&&
(
HandleToUlong
(
handle
)
>=
HandleToUlong
(
HKEY_SPECIAL_ROOT_FIRST
))
&&
(
HandleToUlong
(
handle
)
<=
HandleToUlong
(
HKEY_SPECIAL_ROOT_LAST
)))
&&
(
HandleToUlong
(
handle
)
<=
HandleToUlong
(
HKEY_SPECIAL_ROOT_LAST
)))
{
{
...
@@ -1562,6 +1568,11 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
...
@@ -1562,6 +1568,11 @@ DWORD WINAPI GetSecurityInfo( HANDLE handle, SE_OBJECT_TYPE type, SECURITY_INFOR
return
RtlNtStatusToDosError
(
status
);
return
RtlNtStatusToDosError
(
status
);
}
}
RegCloseKey
(
key
);
RegCloseKey
(
key
);
break
;
default:
FIXME
(
"unimplemented type %u
\n
"
,
type
);
return
ERROR_CALL_NOT_IMPLEMENTED
;
}
}
if
(
ppsidOwner
)
if
(
ppsidOwner
)
...
...
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