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
da1784bb
Commit
da1784bb
authored
Aug 17, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Don't use the cached file mode when setting the security descriptor.
parent
74a63029
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
20 deletions
+12
-20
change.c
server/change.c
+6
-10
file.c
server/file.c
+6
-10
No files found.
server/change.c
View file @
da1784bb
...
...
@@ -342,6 +342,7 @@ static int dir_set_sd( struct object *obj, const struct security_descriptor *sd,
{
struct
dir
*
dir
=
(
struct
dir
*
)
obj
;
const
SID
*
owner
;
struct
stat
st
;
mode_t
mode
;
int
unix_fd
;
...
...
@@ -349,7 +350,7 @@ static int dir_set_sd( struct object *obj, const struct security_descriptor *sd,
unix_fd
=
get_dir_unix_fd
(
dir
);
if
(
unix_fd
==
-
1
)
return
1
;
if
(
unix_fd
==
-
1
||
fstat
(
unix_fd
,
&
st
)
==
-
1
)
return
1
;
if
(
set_info
&
OWNER_SECURITY_INFORMATION
)
{
...
...
@@ -372,18 +373,13 @@ static int dir_set_sd( struct object *obj, const struct security_descriptor *sd,
if
(
set_info
&
DACL_SECURITY_INFORMATION
)
{
/* keep the bits that we don't map to access rights in the ACL */
mode
=
dir
->
mode
&
(
S_ISUID
|
S_ISGID
|
S_ISVTX
|
S_IRWXG
);
mode
=
st
.
st_
mode
&
(
S_ISUID
|
S_ISGID
|
S_ISVTX
|
S_IRWXG
);
mode
|=
sd_to_mode
(
sd
,
owner
);
if
(
dir
->
mode
!=
mode
)
if
(
st
.
st_mode
!=
mode
&&
fchmod
(
unix_fd
,
mode
)
==
-
1
)
{
if
(
fchmod
(
unix_fd
,
mode
)
==
-
1
)
{
file_set_error
();
return
0
;
}
dir
->
mode
=
mode
;
file_set_error
();
return
0
;
}
}
return
1
;
...
...
server/file.c
View file @
da1784bb
...
...
@@ -535,6 +535,7 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
{
struct
file
*
file
=
(
struct
file
*
)
obj
;
const
SID
*
owner
;
struct
stat
st
;
mode_t
mode
;
int
unix_fd
;
...
...
@@ -542,7 +543,7 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
unix_fd
=
get_file_unix_fd
(
file
);
if
(
unix_fd
==
-
1
)
return
1
;
if
(
unix_fd
==
-
1
||
fstat
(
unix_fd
,
&
st
)
==
-
1
)
return
1
;
if
(
set_info
&
OWNER_SECURITY_INFORMATION
)
{
...
...
@@ -567,18 +568,13 @@ static int file_set_sd( struct object *obj, const struct security_descriptor *sd
if
(
set_info
&
DACL_SECURITY_INFORMATION
)
{
/* keep the bits that we don't map to access rights in the ACL */
mode
=
file
->
mode
&
(
S_ISUID
|
S_ISGID
|
S_ISVTX
|
S_IRWXG
);
mode
=
st
.
st_
mode
&
(
S_ISUID
|
S_ISGID
|
S_ISVTX
|
S_IRWXG
);
mode
|=
sd_to_mode
(
sd
,
owner
);
if
(
file
->
mode
!=
mode
)
if
(
st
.
st_mode
!=
mode
&&
fchmod
(
unix_fd
,
mode
)
==
-
1
)
{
if
(
fchmod
(
unix_fd
,
mode
)
==
-
1
)
{
file_set_error
();
return
0
;
}
file
->
mode
=
mode
;
file_set_error
();
return
0
;
}
}
return
1
;
...
...
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