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
00b3f055
Commit
00b3f055
authored
Mar 27, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 31, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fix DACL to permissions conversion.
parent
f2f5cd83
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
security.c
dlls/advapi32/tests/security.c
+2
-1
file.c
server/file.c
+14
-8
No files found.
dlls/advapi32/tests/security.c
View file @
00b3f055
...
...
@@ -3484,7 +3484,8 @@ static void test_GetNamedSecurityInfoA(void)
h
=
CreateFileA
(
tmpfile
,
GENERIC_READ
,
FILE_SHARE_DELETE
|
FILE_SHARE_WRITE
|
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
todo_wine
ok
(
h
!=
INVALID_HANDLE_VALUE
,
"CreateFile error %d
\n
"
,
GetLastError
());
ok
(
h
!=
INVALID_HANDLE_VALUE
,
"CreateFile error %d
\n
"
,
GetLastError
());
CloseHandle
(
h
);
bret
=
InitializeAcl
(
pDacl
,
100
,
ACL_REVISION
);
ok
(
bret
,
"Failed to initialize ACL.
\n
"
);
...
...
server/file.c
View file @
00b3f055
...
...
@@ -473,7 +473,7 @@ static mode_t file_access_to_mode( unsigned int access )
mode_t
sd_to_mode
(
const
struct
security_descriptor
*
sd
,
const
SID
*
owner
)
{
mode_t
new_mode
=
0
;
mode_t
denied_mode
=
0
;
mode_t
bits_to_set
=
~
0
;
mode_t
mode
;
int
present
;
const
ACL
*
dacl
=
sd_get_dacl
(
sd
,
&
present
);
...
...
@@ -498,16 +498,16 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
mode
=
file_access_to_mode
(
ad_ace
->
Mask
);
if
(
security_equal_sid
(
sid
,
security_world_sid
))
{
denied_mode
|=
(
mode
<<
6
)
|
(
mode
<<
3
)
|
mode
;
/* all */
bits_to_set
&=
~
((
mode
<<
6
)
|
(
mode
<<
3
)
|
mode
)
;
/* all */
}
else
if
((
security_equal_sid
(
user
,
owner
)
&&
token_sid_present
(
current
->
process
->
token
,
sid
,
TRUE
)))
{
denied_mode
|=
(
mode
<<
6
)
|
(
mode
<<
3
);
/* user + group */
bits_to_set
&=
~
((
mode
<<
6
)
|
(
mode
<<
3
)
);
/* user + group */
}
else
if
(
security_equal_sid
(
sid
,
owner
))
{
denied_mode
|=
(
mode
<<
6
);
/* user only */
bits_to_set
&=
~
(
mode
<<
6
);
/* user only */
}
break
;
case
ACCESS_ALLOWED_ACE_TYPE
:
...
...
@@ -516,16 +516,22 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
mode
=
file_access_to_mode
(
aa_ace
->
Mask
);
if
(
security_equal_sid
(
sid
,
security_world_sid
))
{
new_mode
|=
(
mode
<<
6
)
|
(
mode
<<
3
)
|
mode
;
/* all */
mode
=
(
mode
<<
6
)
|
(
mode
<<
3
)
|
mode
;
/* all */
new_mode
|=
mode
&
bits_to_set
;
bits_to_set
&=
~
mode
;
}
else
if
((
security_equal_sid
(
user
,
owner
)
&&
token_sid_present
(
current
->
process
->
token
,
sid
,
FALSE
)))
{
new_mode
|=
(
mode
<<
6
)
|
(
mode
<<
3
);
/* user + group */
mode
=
(
mode
<<
6
)
|
(
mode
<<
3
);
/* user + group */
new_mode
|=
mode
&
bits_to_set
;
bits_to_set
&=
~
mode
;
}
else
if
(
security_equal_sid
(
sid
,
owner
))
{
new_mode
|=
(
mode
<<
6
);
/* user only */
mode
=
(
mode
<<
6
);
/* user only */
new_mode
|=
mode
&
bits_to_set
;
bits_to_set
&=
~
mode
;
}
break
;
}
...
...
@@ -535,7 +541,7 @@ mode_t sd_to_mode( const struct security_descriptor *sd, const SID *owner )
/* no ACL means full access rights to anyone */
new_mode
=
S_IRWXU
|
S_IRWXG
|
S_IRWXO
;
return
new_mode
&
~
denied_mode
;
return
new_mode
;
}
static
int
file_set_sd
(
struct
object
*
obj
,
const
struct
security_descriptor
*
sd
,
...
...
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