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
1a0f0826
Commit
1a0f0826
authored
Apr 25, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store the full group attributes.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3eb944c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
31 deletions
+10
-31
token.c
server/token.c
+10
-31
No files found.
server/token.c
View file @
1a0f0826
...
...
@@ -128,15 +128,9 @@ struct privilege
struct
group
{
struct
list
entry
;
unsigned
enabled
:
1
;
/* is the sid currently enabled? */
unsigned
def
:
1
;
/* is the sid enabled by default? */
unsigned
logon
:
1
;
/* is this a logon sid? */
unsigned
mandatory
:
1
;
/* is this sid always enabled? */
unsigned
owner
:
1
;
/* can this sid be an owner of an object? */
unsigned
resource
:
1
;
/* is this a domain-local group? */
unsigned
deny_only
:
1
;
/* is this a sid that should be use for denying only? */
struct
sid
sid
;
struct
list
entry
;
unsigned
int
attrs
;
struct
sid
sid
;
};
static
void
token_dump
(
struct
object
*
obj
,
int
verbose
);
...
...
@@ -523,17 +517,11 @@ static struct token *create_token( unsigned int primary, unsigned int session_id
release_object
(
token
);
return
NULL
;
}
group
->
attrs
=
groups
[
i
].
attrs
;
copy_sid
(
&
group
->
sid
,
groups
[
i
].
sid
);
group
->
enabled
=
TRUE
;
group
->
def
=
TRUE
;
group
->
logon
=
(
groups
[
i
].
attrs
&
SE_GROUP_LOGON_ID
)
!=
0
;
group
->
mandatory
=
(
groups
[
i
].
attrs
&
SE_GROUP_MANDATORY
)
!=
0
;
group
->
owner
=
(
groups
[
i
].
attrs
&
SE_GROUP_OWNER
)
!=
0
;
group
->
resource
=
FALSE
;
group
->
deny_only
=
FALSE
;
list_add_tail
(
&
token
->
groups
,
&
group
->
entry
);
/* Use first owner capable group as owner and primary group */
if
(
!
token
->
primary_group
&&
group
->
owner
)
if
(
!
token
->
primary_group
&&
(
group
->
attrs
&
SE_GROUP_OWNER
)
)
{
token
->
owner
=
&
group
->
sid
;
token
->
primary_group
=
&
group
->
sid
;
...
...
@@ -628,9 +616,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
memcpy
(
newgroup
,
group
,
size
);
if
(
filter_group
(
group
,
remove_groups
,
remove_group_count
))
{
newgroup
->
enabled
=
0
;
newgroup
->
def
=
0
;
newgroup
->
deny_only
=
1
;
newgroup
->
attrs
&=
~
(
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
);
newgroup
->
attrs
|=
SE_GROUP_USE_FOR_DENY_ONLY
;
}
list_add_tail
(
&
token
->
groups
,
&
newgroup
->
entry
);
if
(
src_token
->
primary_group
==
&
group
->
sid
)
...
...
@@ -888,8 +875,8 @@ int token_sid_present( struct token *token, const struct sid *sid, int deny )
LIST_FOR_EACH_ENTRY
(
group
,
&
token
->
groups
,
struct
group
,
entry
)
{
if
(
!
group
->
enabled
)
continue
;
if
(
group
->
deny_only
&&
!
deny
)
continue
;
if
(
!
(
group
->
attrs
&
SE_GROUP_ENABLED
)
)
continue
;
if
(
!
deny
&&
(
group
->
attrs
&
SE_GROUP_USE_FOR_DENY_ONLY
)
)
continue
;
if
(
equal_sid
(
&
group
->
sid
,
sid
))
return
TRUE
;
}
...
...
@@ -1411,16 +1398,8 @@ DECL_HANDLER(get_token_groups)
{
LIST_FOR_EACH_ENTRY
(
group
,
&
token
->
groups
,
const
struct
group
,
entry
)
{
*
attr_ptr
=
0
;
if
(
group
->
mandatory
)
*
attr_ptr
|=
SE_GROUP_MANDATORY
;
if
(
group
->
def
)
*
attr_ptr
|=
SE_GROUP_ENABLED_BY_DEFAULT
;
if
(
group
->
enabled
)
*
attr_ptr
|=
SE_GROUP_ENABLED
;
if
(
group
->
owner
)
*
attr_ptr
|=
SE_GROUP_OWNER
;
if
(
group
->
deny_only
)
*
attr_ptr
|=
SE_GROUP_USE_FOR_DENY_ONLY
;
if
(
group
->
resource
)
*
attr_ptr
|=
SE_GROUP_RESOURCE
;
if
(
group
->
logon
)
*
attr_ptr
|=
SE_GROUP_LOGON_ID
;
sid
=
copy_sid
(
sid
,
&
group
->
sid
);
attr_ptr
++
;
*
attr_ptr
++
=
group
->
attrs
;
}
}
}
...
...
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