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
6413a9c1
Commit
6413a9c1
authored
Feb 09, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Feb 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Get the primary group from the token's groups.
parent
63cdee27
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
token.c
server/token.c
+11
-2
No files found.
server/token.c
View file @
6413a9c1
...
@@ -80,6 +80,7 @@ struct token
...
@@ -80,6 +80,7 @@ struct token
struct
list
privileges
;
/* privileges available to the token */
struct
list
privileges
;
/* privileges available to the token */
struct
list
groups
;
/* groups that the user of this token belongs to (sid_and_attributes) */
struct
list
groups
;
/* groups that the user of this token belongs to (sid_and_attributes) */
SID
*
user
;
/* SID of user this token represents */
SID
*
user
;
/* SID of user this token represents */
SID
*
primary_group
;
/* SID of user's primary group */
unsigned
primary
;
/* is this a primary or impersonation token? */
unsigned
primary
;
/* is this a primary or impersonation token? */
ACL
*
default_dacl
;
/* the default DACL to assign to objects created by this user */
ACL
*
default_dacl
;
/* the default DACL to assign to objects created by this user */
TOKEN_SOURCE
source
;
/* source of the token */
TOKEN_SOURCE
source
;
/* source of the token */
...
@@ -425,6 +426,7 @@ static struct token *create_token( unsigned primary, const SID *user,
...
@@ -425,6 +426,7 @@ static struct token *create_token( unsigned primary, const SID *user,
list_init
(
&
token
->
groups
);
list_init
(
&
token
->
groups
);
token
->
primary
=
primary
;
token
->
primary
=
primary
;
token
->
default_dacl
=
NULL
;
token
->
default_dacl
=
NULL
;
token
->
primary_group
=
NULL
;
/* copy user */
/* copy user */
token
->
user
=
memdup
(
user
,
FIELD_OFFSET
(
SID
,
SubAuthority
[
user
->
SubAuthorityCount
])
);
token
->
user
=
memdup
(
user
,
FIELD_OFFSET
(
SID
,
SubAuthority
[
user
->
SubAuthorityCount
])
);
...
@@ -450,10 +452,13 @@ static struct token *create_token( unsigned primary, const SID *user,
...
@@ -450,10 +452,13 @@ static struct token *create_token( unsigned primary, const SID *user,
group
->
def
=
TRUE
;
group
->
def
=
TRUE
;
group
->
logon
=
FALSE
;
group
->
logon
=
FALSE
;
group
->
mandatory
=
(
groups
[
i
].
Attributes
&
SE_GROUP_MANDATORY
)
?
TRUE
:
FALSE
;
group
->
mandatory
=
(
groups
[
i
].
Attributes
&
SE_GROUP_MANDATORY
)
?
TRUE
:
FALSE
;
group
->
owner
=
FALSE
;
group
->
owner
=
groups
[
i
].
Attributes
&
SE_GROUP_OWNER
?
TRUE
:
FALSE
;
group
->
resource
=
FALSE
;
group
->
resource
=
FALSE
;
group
->
deny_only
=
FALSE
;
group
->
deny_only
=
FALSE
;
list_add_tail
(
&
token
->
groups
,
&
group
->
entry
);
list_add_tail
(
&
token
->
groups
,
&
group
->
entry
);
/* Use first owner capable group as an owner */
if
(
!
token
->
primary_group
&&
group
->
owner
)
token
->
primary_group
=
&
group
->
sid
;
}
}
/* copy privileges */
/* copy privileges */
...
@@ -582,7 +587,7 @@ struct token *token_create_admin( void )
...
@@ -582,7 +587,7 @@ struct token *token_create_admin( void )
{
security_local_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
{
security_local_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
{
security_interactive_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
{
security_interactive_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
{
security_authenticated_user_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
{
security_authenticated_user_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
{
alias_admins_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
{
alias_admins_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
|
SE_GROUP_OWNER
},
{
alias_users_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
{
alias_users_sid
,
SE_GROUP_ENABLED
|
SE_GROUP_ENABLED_BY_DEFAULT
|
SE_GROUP_MANDATORY
},
};
};
static
const
TOKEN_SOURCE
admin_source
=
{
"SeMgr"
,
{
0
,
0
}};
static
const
TOKEN_SOURCE
admin_source
=
{
"SeMgr"
,
{
0
,
0
}};
...
@@ -592,6 +597,8 @@ struct token *token_create_admin( void )
...
@@ -592,6 +597,8 @@ struct token *token_create_admin( void )
admin_groups
,
sizeof
(
admin_groups
)
/
sizeof
(
admin_groups
[
0
]),
admin_groups
,
sizeof
(
admin_groups
)
/
sizeof
(
admin_groups
[
0
]),
admin_privs
,
sizeof
(
admin_privs
)
/
sizeof
(
admin_privs
[
0
]),
admin_privs
,
sizeof
(
admin_privs
)
/
sizeof
(
admin_privs
[
0
]),
default_dacl
,
admin_source
);
default_dacl
,
admin_source
);
/* we really need a primary group */
assert
(
token
->
primary_group
);
}
}
free
(
alias_admins_sid
);
free
(
alias_admins_sid
);
...
@@ -1024,6 +1031,8 @@ DECL_HANDLER(duplicate_token)
...
@@ -1024,6 +1031,8 @@ DECL_HANDLER(duplicate_token)
memcpy
(
newgroup
,
group
,
size
);
memcpy
(
newgroup
,
group
,
size
);
list_add_tail
(
&
token
->
groups
,
&
newgroup
->
entry
);
list_add_tail
(
&
token
->
groups
,
&
newgroup
->
entry
);
}
}
token
->
primary_group
=
src_token
->
primary_group
;
assert
(
token
->
primary_group
);
/* copy privileges */
/* copy privileges */
LIST_FOR_EACH_ENTRY
(
privilege
,
&
src_token
->
privileges
,
struct
privilege
,
entry
)
LIST_FOR_EACH_ENTRY
(
privilege
,
&
src_token
->
privileges
,
struct
privilege
,
entry
)
...
...
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