Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f6d871ee
Commit
f6d871ee
authored
Mar 26, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: impersonation_level should be an int since we store -1 in it.
Make sure we don't check the impersonation level for primary tokens.
parent
6cb602c6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
security.h
server/security.h
+1
-1
token.c
server/token.c
+8
-9
No files found.
server/security.h
View file @
f6d871ee
...
...
@@ -48,7 +48,7 @@ extern const PSID security_local_system_sid;
extern
struct
token
*
token_create_admin
(
void
);
extern
struct
token
*
token_duplicate
(
struct
token
*
src_token
,
unsigned
primary
,
SECURITY_IMPERSONATION_LEVEL
impersonation_level
);
int
impersonation_level
);
extern
int
token_check_privileges
(
struct
token
*
token
,
int
all_required
,
const
LUID_AND_ATTRIBUTES
*
reqprivs
,
unsigned
int
count
,
LUID_AND_ATTRIBUTES
*
usedprivs
);
...
...
server/token.c
View file @
f6d871ee
...
...
@@ -90,7 +90,7 @@ struct token
unsigned
primary
;
/* is this a primary or impersonation token? */
ACL
*
default_dacl
;
/* the default DACL to assign to objects created by this user */
TOKEN_SOURCE
source
;
/* source of the token */
SECURITY_IMPERSONATION_LEVEL
impersonation_level
;
/* impersonation level this token is capable of if non-primary token */
int
impersonation_level
;
/* impersonation level this token is capable of if non-primary token */
};
struct
privilege
...
...
@@ -421,7 +421,7 @@ static struct token *create_token( unsigned primary, const SID *user,
const
LUID_AND_ATTRIBUTES
*
privs
,
unsigned
int
priv_count
,
const
ACL
*
default_dacl
,
TOKEN_SOURCE
source
,
const
luid_t
*
modified_id
,
SECURITY_IMPERSONATION_LEVEL
impersonation_level
)
int
impersonation_level
)
{
struct
token
*
token
=
alloc_object
(
&
token_ops
);
if
(
token
)
...
...
@@ -506,7 +506,7 @@ static struct token *create_token( unsigned primary, const SID *user,
}
struct
token
*
token_duplicate
(
struct
token
*
src_token
,
unsigned
primary
,
SECURITY_IMPERSONATION_LEVEL
impersonation_level
)
int
impersonation_level
)
{
const
luid_t
*
modified_id
=
primary
||
(
impersonation_level
==
src_token
->
impersonation_level
)
?
...
...
@@ -515,20 +515,19 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
struct
privilege
*
privilege
;
struct
group
*
group
;
if
((
impersonation_level
<
SecurityAnonymous
)
||
(
impersonation_level
>
SecurityDelegation
))
if
(
!
primary
&&
(
impersonation_level
<
SecurityAnonymous
||
impersonation_level
>
SecurityDelegation
||
(
!
src_token
->
primary
&&
(
impersonation_level
>
src_token
->
impersonation_level
))))
{
set_error
(
STATUS_BAD_IMPERSONATION_LEVEL
);
return
NULL
;
}
if
(
primary
||
(
impersonation_level
<=
src_token
->
impersonation_level
))
token
=
create_token
(
primary
,
src_token
->
user
,
NULL
,
0
,
NULL
,
0
,
src_token
->
default_dacl
,
src_token
->
source
,
modified_id
,
impersonation_level
);
else
set_error
(
STATUS_BAD_IMPERSONATION_LEVEL
);
if
(
!
token
)
return
token
;
/* copy groups */
...
...
@@ -1013,7 +1012,7 @@ DECL_HANDLER(open_token)
{
if
(
thread
->
token
)
{
if
(
thread
->
token
->
impersonation_level
<=
SecurityAnonymous
)
if
(
!
thread
->
token
->
primary
&&
thread
->
token
->
impersonation_level
<=
SecurityAnonymous
)
set_error
(
STATUS_CANT_OPEN_ANONYMOUS
);
else
reply
->
token
=
alloc_handle
(
current
->
process
,
thread
->
token
,
...
...
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