Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
6d19aa83
Commit
6d19aa83
authored
10 years ago
by
Joris van der Wel
Committed by
Alexandre Julliard
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
server: A new function "set_sd_defaults_from_token".
parent
0480bbfb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/object.c
+16
-9
16 additions, 9 deletions
server/object.c
server/object.h
+2
-0
2 additions, 0 deletions
server/object.h
with
18 additions
and
9 deletions
server/object.c
+
16
−
9
View file @
6d19aa83
...
...
@@ -423,12 +423,12 @@ struct security_descriptor *default_get_sd( struct object *obj )
return
obj
->
sd
;
}
int
default_set_sd
(
struct
object
*
obj
,
const
struct
security_descriptor
*
sd
,
unsigned
int
set_info
)
int
set_sd_defaults_from_token
(
struct
object
*
obj
,
const
struct
security_descriptor
*
sd
,
unsigned
int
set_info
,
struct
token
*
token
)
{
struct
security_descriptor
new_sd
,
*
new_sd_ptr
;
int
present
;
const
SID
*
owner
,
*
group
;
const
SID
*
owner
=
NULL
,
*
group
=
NULL
;
const
ACL
*
sacl
,
*
dacl
;
char
*
ptr
;
...
...
@@ -446,9 +446,9 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd,
owner
=
sd_get_owner
(
obj
->
sd
);
new_sd
.
owner_len
=
obj
->
sd
->
owner_len
;
}
else
else
if
(
token
)
{
owner
=
token_get_user
(
current
->
process
->
token
);
owner
=
token_get_user
(
token
);
new_sd
.
owner_len
=
security_sid_len
(
owner
);
}
...
...
@@ -462,9 +462,9 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd,
group
=
sd_get_group
(
obj
->
sd
);
new_sd
.
group_len
=
obj
->
sd
->
group_len
;
}
else
else
if
(
token
)
{
group
=
token_get_primary_group
(
current
->
process
->
token
);
group
=
token_get_primary_group
(
token
);
new_sd
.
group_len
=
security_sid_len
(
group
);
}
...
...
@@ -494,9 +494,9 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd,
if
(
obj
->
sd
&&
present
)
new_sd
.
dacl_len
=
obj
->
sd
->
dacl_len
;
else
else
if
(
token
)
{
dacl
=
token_get_default_dacl
(
current
->
process
->
token
);
dacl
=
token_get_default_dacl
(
token
);
new_sd
.
dacl_len
=
dacl
->
AclSize
;
}
}
...
...
@@ -521,6 +521,13 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd,
return
1
;
}
/** Set the security descriptor using the current primary token for defaults. */
int
default_set_sd
(
struct
object
*
obj
,
const
struct
security_descriptor
*
sd
,
unsigned
int
set_info
)
{
return
set_sd_defaults_from_token
(
obj
,
sd
,
set_info
,
current
->
process
->
token
);
}
struct
object
*
no_lookup_name
(
struct
object
*
obj
,
struct
unicode_str
*
name
,
unsigned
int
attr
)
{
...
...
This diff is collapsed.
Click to expand it.
server/object.h
+
2
−
0
View file @
6d19aa83
...
...
@@ -139,6 +139,8 @@ extern struct fd *no_get_fd( struct object *obj );
extern
unsigned
int
no_map_access
(
struct
object
*
obj
,
unsigned
int
access
);
extern
struct
security_descriptor
*
default_get_sd
(
struct
object
*
obj
);
extern
int
default_set_sd
(
struct
object
*
obj
,
const
struct
security_descriptor
*
sd
,
unsigned
int
set_info
);
extern
int
set_sd_defaults_from_token
(
struct
object
*
obj
,
const
struct
security_descriptor
*
sd
,
unsigned
int
set_info
,
struct
token
*
token
);
extern
struct
object
*
no_lookup_name
(
struct
object
*
obj
,
struct
unicode_str
*
name
,
unsigned
int
attributes
);
extern
struct
object
*
no_open_file
(
struct
object
*
obj
,
unsigned
int
access
,
unsigned
int
sharing
,
unsigned
int
options
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment