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
611f57bc
Commit
611f57bc
authored
Sep 27, 2007
by
Mikolaj Zalewski
Committed by
Alexandre Julliard
Sep 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/ntdll: GetSecurityDescriptorOwner/Group should fill isDefaulted also for NULL sids.
parent
3c51b2c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
security.c
dlls/advapi32/tests/security.c
+3
-3
sec.c
dlls/ntdll/sec.c
+10
-9
No files found.
dlls/advapi32/tests/security.c
View file @
611f57bc
...
@@ -1460,7 +1460,7 @@ static void test_security_descriptor(void)
...
@@ -1460,7 +1460,7 @@ static void test_security_descriptor(void)
InitializeSecurityDescriptor
(
&
sd
,
SECURITY_DESCRIPTOR_REVISION
);
InitializeSecurityDescriptor
(
&
sd
,
SECURITY_DESCRIPTOR_REVISION
);
ok
(
GetSecurityDescriptorOwner
(
&
sd
,
&
psid
,
&
isDefault
),
"GetSecurityDescriptorOwner failed
\n
"
);
ok
(
GetSecurityDescriptorOwner
(
&
sd
,
&
psid
,
&
isDefault
),
"GetSecurityDescriptorOwner failed
\n
"
);
expect_eq
(
psid
,
NULL
,
PSID
,
"%p"
);
expect_eq
(
psid
,
NULL
,
PSID
,
"%p"
);
todo_wine
expect_eq
(
isDefault
,
FALSE
,
BOOL
,
"%d"
);
expect_eq
(
isDefault
,
FALSE
,
BOOL
,
"%d"
);
sd
.
Control
|=
SE_DACL_PRESENT
|
SE_SACL_PRESENT
;
sd
.
Control
|=
SE_DACL_PRESENT
|
SE_SACL_PRESENT
;
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -1473,10 +1473,10 @@ static void test_security_descriptor(void)
...
@@ -1473,10 +1473,10 @@ static void test_security_descriptor(void)
expect_eq
(
MakeSelfRelativeSD
(
&
sd
,
buf
,
&
size
),
TRUE
,
BOOL
,
"%d"
);
expect_eq
(
MakeSelfRelativeSD
(
&
sd
,
buf
,
&
size
),
TRUE
,
BOOL
,
"%d"
);
ok
(
GetSecurityDescriptorOwner
(
&
sd
,
&
psid
,
&
isDefault
),
"GetSecurityDescriptorOwner failed
\n
"
);
ok
(
GetSecurityDescriptorOwner
(
&
sd
,
&
psid
,
&
isDefault
),
"GetSecurityDescriptorOwner failed
\n
"
);
expect_eq
(
psid
,
NULL
,
PSID
,
"%p"
);
expect_eq
(
psid
,
NULL
,
PSID
,
"%p"
);
todo_wine
expect_eq
(
isDefault
,
FALSE
,
BOOL
,
"%d"
);
expect_eq
(
isDefault
,
FALSE
,
BOOL
,
"%d"
);
ok
(
GetSecurityDescriptorGroup
(
&
sd
,
&
psid
,
&
isDefault
),
"GetSecurityDescriptorOwner failed
\n
"
);
ok
(
GetSecurityDescriptorGroup
(
&
sd
,
&
psid
,
&
isDefault
),
"GetSecurityDescriptorOwner failed
\n
"
);
expect_eq
(
psid
,
NULL
,
PSID
,
"%p"
);
expect_eq
(
psid
,
NULL
,
PSID
,
"%p"
);
todo_wine
expect_eq
(
isDefault
,
FALSE
,
BOOL
,
"%d"
);
expect_eq
(
isDefault
,
FALSE
,
BOOL
,
"%d"
);
ok
(
GetSecurityDescriptorDacl
(
&
sd
,
&
isPresent
,
&
pacl
,
&
isDefault
),
"GetSecurityDescriptorOwner failed
\n
"
);
ok
(
GetSecurityDescriptorDacl
(
&
sd
,
&
isPresent
,
&
pacl
,
&
isDefault
),
"GetSecurityDescriptorOwner failed
\n
"
);
expect_eq
(
isPresent
,
TRUE
,
BOOL
,
"%d"
);
expect_eq
(
isPresent
,
TRUE
,
BOOL
,
"%d"
);
expect_eq
(
psid
,
NULL
,
PSID
,
"%p"
);
expect_eq
(
psid
,
NULL
,
PSID
,
"%p"
);
...
...
dlls/ntdll/sec.c
View file @
611f57bc
...
@@ -713,6 +713,11 @@ NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
...
@@ -713,6 +713,11 @@ NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
if
(
!
lpsd
||
!
Owner
||
!
OwnerDefaulted
)
if
(
!
lpsd
||
!
Owner
||
!
OwnerDefaulted
)
return
STATUS_INVALID_PARAMETER
;
return
STATUS_INVALID_PARAMETER
;
if
(
lpsd
->
Control
&
SE_OWNER_DEFAULTED
)
*
OwnerDefaulted
=
TRUE
;
else
*
OwnerDefaulted
=
FALSE
;
if
(
lpsd
->
Owner
!=
NULL
)
if
(
lpsd
->
Owner
!=
NULL
)
{
{
if
(
lpsd
->
Control
&
SE_SELF_RELATIVE
)
if
(
lpsd
->
Control
&
SE_SELF_RELATIVE
)
...
@@ -720,10 +725,6 @@ NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
...
@@ -720,10 +725,6 @@ NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
else
else
*
Owner
=
lpsd
->
Owner
;
*
Owner
=
lpsd
->
Owner
;
if
(
lpsd
->
Control
&
SE_OWNER_DEFAULTED
)
*
OwnerDefaulted
=
TRUE
;
else
*
OwnerDefaulted
=
FALSE
;
}
}
else
else
*
Owner
=
NULL
;
*
Owner
=
NULL
;
...
@@ -790,17 +791,17 @@ NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
...
@@ -790,17 +791,17 @@ NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
if
(
!
lpsd
||
!
Group
||
!
GroupDefaulted
)
if
(
!
lpsd
||
!
Group
||
!
GroupDefaulted
)
return
STATUS_INVALID_PARAMETER
;
return
STATUS_INVALID_PARAMETER
;
if
(
lpsd
->
Control
&
SE_GROUP_DEFAULTED
)
*
GroupDefaulted
=
TRUE
;
else
*
GroupDefaulted
=
FALSE
;
if
(
lpsd
->
Group
!=
NULL
)
if
(
lpsd
->
Group
!=
NULL
)
{
{
if
(
lpsd
->
Control
&
SE_SELF_RELATIVE
)
if
(
lpsd
->
Control
&
SE_SELF_RELATIVE
)
*
Group
=
(
PSID
)((
LPBYTE
)
lpsd
+
(
ULONG_PTR
)
lpsd
->
Group
);
*
Group
=
(
PSID
)((
LPBYTE
)
lpsd
+
(
ULONG_PTR
)
lpsd
->
Group
);
else
else
*
Group
=
lpsd
->
Group
;
*
Group
=
lpsd
->
Group
;
if
(
lpsd
->
Control
&
SE_GROUP_DEFAULTED
)
*
GroupDefaulted
=
TRUE
;
else
*
GroupDefaulted
=
FALSE
;
}
}
else
else
*
Group
=
NULL
;
*
Group
=
NULL
;
...
...
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