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
03d99df5
Commit
03d99df5
authored
Apr 27, 2013
by
Erich Hoover
Committed by
Alexandre Julliard
Apr 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add builtin admins ACE to default registry DACL.
parent
171abcc4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
security.c
dlls/advapi32/tests/security.c
+16
-2
registry.c
server/registry.c
+9
-2
No files found.
dlls/advapi32/tests/security.c
View file @
03d99df5
...
@@ -3012,12 +3012,12 @@ static void test_GetNamedSecurityInfoA(void)
...
@@ -3012,12 +3012,12 @@ static void test_GetNamedSecurityInfoA(void)
PSID
system_sid
=
(
PSID
)
system_ptr
,
user_sid
;
PSID
system_sid
=
(
PSID
)
system_ptr
,
user_sid
;
DWORD
sid_size
=
sizeof
(
admin_ptr
),
user_size
;
DWORD
sid_size
=
sizeof
(
admin_ptr
),
user_size
;
char
invalid_path
[]
=
"/an invalid file path"
;
char
invalid_path
[]
=
"/an invalid file path"
;
int
users_ace_id
=
-
1
,
admins_ace_id
=
-
1
,
i
;
char
software_key
[]
=
"MACHINE
\\
Software"
;
char
software_key
[]
=
"MACHINE
\\
Software"
;
char
sd
[
SECURITY_DESCRIPTOR_MIN_LENGTH
];
char
sd
[
SECURITY_DESCRIPTOR_MIN_LENGTH
];
SECURITY_DESCRIPTOR_CONTROL
control
;
SECURITY_DESCRIPTOR_CONTROL
control
;
ACL_SIZE_INFORMATION
acl_size
;
ACL_SIZE_INFORMATION
acl_size
;
CHAR
windows_dir
[
MAX_PATH
];
CHAR
windows_dir
[
MAX_PATH
];
int
users_ace_id
=
-
1
,
i
;
PSECURITY_DESCRIPTOR
pSD
;
PSECURITY_DESCRIPTOR
pSD
;
ACCESS_ALLOWED_ACE
*
ace
;
ACCESS_ALLOWED_ACE
*
ace
;
BOOL
bret
=
TRUE
,
isNT4
;
BOOL
bret
=
TRUE
,
isNT4
;
...
@@ -3030,6 +3030,7 @@ static void test_GetNamedSecurityInfoA(void)
...
@@ -3030,6 +3030,7 @@ static void test_GetNamedSecurityInfoA(void)
PSID
owner
,
group
;
PSID
owner
,
group
;
BOOL
dacl_present
;
BOOL
dacl_present
;
PACL
pDacl
;
PACL
pDacl
;
BYTE
flags
;
if
(
!
pSetNamedSecurityInfoA
||
!
pGetNamedSecurityInfoA
||
!
pCreateWellKnownSid
)
if
(
!
pSetNamedSecurityInfoA
||
!
pGetNamedSecurityInfoA
||
!
pCreateWellKnownSid
)
{
{
...
@@ -3228,6 +3229,8 @@ static void test_GetNamedSecurityInfoA(void)
...
@@ -3228,6 +3229,8 @@ static void test_GetNamedSecurityInfoA(void)
ok
(
bret
,
"Failed to get ACE %d.
\n
"
,
i
);
ok
(
bret
,
"Failed to get ACE %d.
\n
"
,
i
);
bret
=
EqualSid
(
&
ace
->
SidStart
,
users_sid
);
bret
=
EqualSid
(
&
ace
->
SidStart
,
users_sid
);
if
(
bret
)
users_ace_id
=
i
;
if
(
bret
)
users_ace_id
=
i
;
bret
=
EqualSid
(
&
ace
->
SidStart
,
admin_sid
);
if
(
bret
)
admins_ace_id
=
i
;
}
}
ok
(
users_ace_id
!=
-
1
,
"Bultin Users ACE not found.
\n
"
);
ok
(
users_ace_id
!=
-
1
,
"Bultin Users ACE not found.
\n
"
);
if
(
users_ace_id
!=
-
1
)
if
(
users_ace_id
!=
-
1
)
...
@@ -3240,7 +3243,18 @@ static void test_GetNamedSecurityInfoA(void)
...
@@ -3240,7 +3243,18 @@ static void test_GetNamedSecurityInfoA(void)
ok
(
ace
->
Mask
==
GENERIC_READ
,
"Builtin Users ACE has unexpected mask (0x%x != 0x%x)
\n
"
,
ok
(
ace
->
Mask
==
GENERIC_READ
,
"Builtin Users ACE has unexpected mask (0x%x != 0x%x)
\n
"
,
ace
->
Mask
,
GENERIC_READ
);
ace
->
Mask
,
GENERIC_READ
);
}
}
ok
(
admins_ace_id
!=
-
1
,
"Bultin Admins ACE not found.
\n
"
);
if
(
admins_ace_id
!=
-
1
)
{
bret
=
pGetAce
(
pDacl
,
admins_ace_id
,
(
VOID
**
)
&
ace
);
ok
(
bret
,
"Failed to get Builtin Admins ACE.
\n
"
);
flags
=
((
ACE_HEADER
*
)
ace
)
->
AceFlags
;
ok
(
flags
==
0x0
||
broken
(
flags
==
(
INHERIT_ONLY_ACE
|
CONTAINER_INHERIT_ACE
|
INHERITED_ACE
))
/* w2k8 */
,
"Builtin Admins ACE has unexpected flags (0x%x != 0x0)
\n
"
,
flags
);
ok
(
ace
->
Mask
==
KEY_ALL_ACCESS
||
broken
(
ace
->
Mask
==
GENERIC_ALL
)
/* w2k8 */
,
"Builtin Admins ACE has unexpected mask (0x%x != 0x%x)
\n
"
,
ace
->
Mask
,
KEY_ALL_ACCESS
);
}
LocalFree
(
pSD
);
LocalFree
(
pSD
);
}
}
...
...
server/registry.c
View file @
03d99df5
...
@@ -347,7 +347,8 @@ static struct security_descriptor *key_get_sd( struct object *obj )
...
@@ -347,7 +347,8 @@ static struct security_descriptor *key_get_sd( struct object *obj )
{
{
size_t
users_sid_len
=
security_sid_len
(
security_builtin_users_sid
);
size_t
users_sid_len
=
security_sid_len
(
security_builtin_users_sid
);
size_t
admins_sid_len
=
security_sid_len
(
security_builtin_admins_sid
);
size_t
admins_sid_len
=
security_sid_len
(
security_builtin_admins_sid
);
size_t
dacl_len
=
sizeof
(
ACL
)
+
offsetof
(
ACCESS_ALLOWED_ACE
,
SidStart
)
+
users_sid_len
;
size_t
dacl_len
=
sizeof
(
ACL
)
+
2
*
offsetof
(
ACCESS_ALLOWED_ACE
,
SidStart
)
+
users_sid_len
+
admins_sid_len
;
ACCESS_ALLOWED_ACE
*
aaa
;
ACCESS_ALLOWED_ACE
*
aaa
;
ACL
*
dacl
;
ACL
*
dacl
;
...
@@ -364,7 +365,7 @@ static struct security_descriptor *key_get_sd( struct object *obj )
...
@@ -364,7 +365,7 @@ static struct security_descriptor *key_get_sd( struct object *obj )
dacl
->
AclRevision
=
ACL_REVISION
;
dacl
->
AclRevision
=
ACL_REVISION
;
dacl
->
Sbz1
=
0
;
dacl
->
Sbz1
=
0
;
dacl
->
AclSize
=
dacl_len
;
dacl
->
AclSize
=
dacl_len
;
dacl
->
AceCount
=
1
;
dacl
->
AceCount
=
2
;
dacl
->
Sbz2
=
0
;
dacl
->
Sbz2
=
0
;
aaa
=
(
ACCESS_ALLOWED_ACE
*
)(
dacl
+
1
);
aaa
=
(
ACCESS_ALLOWED_ACE
*
)(
dacl
+
1
);
aaa
->
Header
.
AceType
=
ACCESS_ALLOWED_ACE_TYPE
;
aaa
->
Header
.
AceType
=
ACCESS_ALLOWED_ACE_TYPE
;
...
@@ -372,6 +373,12 @@ static struct security_descriptor *key_get_sd( struct object *obj )
...
@@ -372,6 +373,12 @@ static struct security_descriptor *key_get_sd( struct object *obj )
aaa
->
Header
.
AceSize
=
offsetof
(
ACCESS_ALLOWED_ACE
,
SidStart
)
+
users_sid_len
;
aaa
->
Header
.
AceSize
=
offsetof
(
ACCESS_ALLOWED_ACE
,
SidStart
)
+
users_sid_len
;
aaa
->
Mask
=
GENERIC_READ
;
aaa
->
Mask
=
GENERIC_READ
;
memcpy
(
&
aaa
->
SidStart
,
security_builtin_users_sid
,
users_sid_len
);
memcpy
(
&
aaa
->
SidStart
,
security_builtin_users_sid
,
users_sid_len
);
aaa
=
(
ACCESS_ALLOWED_ACE
*
)((
char
*
)
aaa
+
aaa
->
Header
.
AceSize
);
aaa
->
Header
.
AceType
=
ACCESS_ALLOWED_ACE_TYPE
;
aaa
->
Header
.
AceFlags
=
0
;
aaa
->
Header
.
AceSize
=
offsetof
(
ACCESS_ALLOWED_ACE
,
SidStart
)
+
admins_sid_len
;
aaa
->
Mask
=
KEY_ALL_ACCESS
;
memcpy
(
&
aaa
->
SidStart
,
security_builtin_admins_sid
,
admins_sid_len
);
}
}
return
key_default_sd
;
return
key_default_sd
;
}
}
...
...
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