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
1b5602e5
Commit
1b5602e5
authored
Mar 24, 2011
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Add excute permission when read file access is allowed.
parent
6bbd0b87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
17 deletions
+7
-17
security.c
dlls/advapi32/tests/security.c
+4
-8
file.c
server/file.c
+3
-9
No files found.
dlls/advapi32/tests/security.c
View file @
1b5602e5
...
...
@@ -881,10 +881,9 @@ cleanup:
SetLastError
(
0xdeadbeef
);
rc
=
AccessCheck
(
sd
,
token
,
FILE_EXECUTE
,
&
mapping
,
&
priv_set
,
&
priv_set_len
,
&
granted
,
&
status
);
ok
(
rc
,
"AccessCheck error %d
\n
"
,
GetLastError
());
todo_wine
{
ok
(
status
==
1
,
"expected 1, got %d
\n
"
,
status
);
ok
(
granted
==
FILE_EXECUTE
,
"expected FILE_EXECUTE, got %#x
\n
"
,
granted
);
}
granted
=
0xdeadbeef
;
status
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
...
...
@@ -906,19 +905,17 @@ todo_wine {
SetLastError
(
0xdeadbeef
);
rc
=
AccessCheck
(
sd
,
token
,
0x1ff
,
&
mapping
,
&
priv_set
,
&
priv_set_len
,
&
granted
,
&
status
);
ok
(
rc
,
"AccessCheck error %d
\n
"
,
GetLastError
());
todo_wine
{
ok
(
status
==
1
,
"expected 1, got %d
\n
"
,
status
);
ok
(
granted
==
0x1ff
,
"expected 0x1ff, got %#x
\n
"
,
granted
);
}
granted
=
0xdeadbeef
;
status
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
rc
=
AccessCheck
(
sd
,
token
,
FILE_ALL_ACCESS
,
&
mapping
,
&
priv_set
,
&
priv_set_len
,
&
granted
,
&
status
);
ok
(
rc
,
"AccessCheck error %d
\n
"
,
GetLastError
());
todo_wine
{
ok
(
status
==
1
,
"expected 1, got %d
\n
"
,
status
);
ok
(
granted
==
FILE_ALL_ACCESS
,
"expected FILE_ALL_ACCESS, got %#x
\n
"
,
granted
);
}
SetLastError
(
0xdeadbeef
);
rc
=
AccessCheck
(
sd
,
token
,
0xffffffff
,
&
mapping
,
&
priv_set
,
&
priv_set_len
,
&
granted
,
&
status
);
ok
(
!
rc
,
"AccessCheck should fail
\n
"
);
...
...
@@ -995,10 +992,9 @@ todo_wine {
SetLastError
(
0xdeadbeef
);
rc
=
AccessCheck
(
sd
,
token
,
FILE_EXECUTE
,
&
mapping
,
&
priv_set
,
&
priv_set_len
,
&
granted
,
&
status
);
ok
(
rc
,
"AccessCheck error %d
\n
"
,
GetLastError
());
todo_wine
{
ok
(
status
==
1
,
"expected 1, got %d
\n
"
,
status
);
ok
(
granted
==
FILE_EXECUTE
,
"expected FILE_EXECUTE, got %#x
\n
"
,
granted
);
}
granted
=
0xdeadbeef
;
status
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
...
...
server/file.c
View file @
1b5602e5
...
...
@@ -358,11 +358,9 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
FIELD_OFFSET
(
SID
,
SubAuthority
[
user
->
SubAuthorityCount
]);
aaa
->
Mask
=
WRITE_DAC
|
WRITE_OWNER
;
if
(
mode
&
S_IRUSR
)
aaa
->
Mask
|=
FILE_GENERIC_READ
;
aaa
->
Mask
|=
FILE_GENERIC_READ
|
FILE_GENERIC_EXECUTE
;
if
(
mode
&
S_IWUSR
)
aaa
->
Mask
|=
FILE_GENERIC_WRITE
|
DELETE
|
FILE_DELETE_CHILD
;
if
(
mode
&
S_IXUSR
)
aaa
->
Mask
|=
FILE_GENERIC_EXECUTE
;
sid
=
(
SID
*
)
&
aaa
->
SidStart
;
memcpy
(
sid
,
user
,
FIELD_OFFSET
(
SID
,
SubAuthority
[
user
->
SubAuthorityCount
])
);
}
...
...
@@ -379,11 +377,9 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
FIELD_OFFSET
(
SID
,
SubAuthority
[
user
->
SubAuthorityCount
]);
ada
->
Mask
=
0
;
if
(
!
(
mode
&
S_IRUSR
)
&&
(
mode
&
(
S_IRGRP
|
S_IROTH
)))
ada
->
Mask
|=
FILE_GENERIC_READ
;
ada
->
Mask
|=
FILE_GENERIC_READ
|
FILE_GENERIC_EXECUTE
;
if
(
!
(
mode
&
S_IWUSR
)
&&
(
mode
&
(
S_IWGRP
|
S_IROTH
)))
ada
->
Mask
|=
FILE_GENERIC_WRITE
|
DELETE
|
FILE_DELETE_CHILD
;
if
(
!
(
mode
&
S_IXUSR
)
&&
(
mode
&
(
S_IXGRP
|
S_IXOTH
)))
ada
->
Mask
|=
FILE_GENERIC_EXECUTE
;
ada
->
Mask
&=
~
STANDARD_RIGHTS_ALL
;
/* never deny standard rights */
sid
=
(
SID
*
)
&
ada
->
SidStart
;
memcpy
(
sid
,
user
,
FIELD_OFFSET
(
SID
,
SubAuthority
[
user
->
SubAuthorityCount
])
);
...
...
@@ -399,11 +395,9 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
FIELD_OFFSET
(
SID
,
SubAuthority
[
world_sid
->
SubAuthorityCount
]);
aaa
->
Mask
=
0
;
if
(
mode
&
S_IROTH
)
aaa
->
Mask
|=
FILE_GENERIC_READ
;
aaa
->
Mask
|=
FILE_GENERIC_READ
|
FILE_GENERIC_EXECUTE
;
if
(
mode
&
S_IWOTH
)
aaa
->
Mask
|=
FILE_GENERIC_WRITE
|
DELETE
|
FILE_DELETE_CHILD
;
if
(
mode
&
S_IXOTH
)
aaa
->
Mask
|=
FILE_GENERIC_EXECUTE
;
sid
=
(
SID
*
)
&
aaa
->
SidStart
;
memcpy
(
sid
,
world_sid
,
FIELD_OFFSET
(
SID
,
SubAuthority
[
world_sid
->
SubAuthorityCount
])
);
}
...
...
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