[Wine-patches] [eter-2.1 2/4] server: Make directory DACL entries inheritable.
Dmitry Timoshkov
dmitry на baikal.ru
Вт Июн 27 09:06:12 MSK 2017
From: Piotr Caban <piotr на codeweavers.com>
---
server/file.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/server/file.c b/server/file.c
index 2cbd1255f5..7f89c26ea0 100644
--- a/server/file.c
+++ b/server/file.c
@@ -369,7 +369,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
aaa = (ACCESS_ALLOWED_ACE *)(dacl + 1);
current_ace = &aaa->Header;
aaa->Header.AceType = ACCESS_ALLOWED_ACE_TYPE;
- aaa->Header.AceFlags = 0;
+ aaa->Header.AceFlags = (mode & S_IFDIR) ? OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE : 0;
aaa->Header.AceSize = FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) +
FIELD_OFFSET(SID, SubAuthority[local_system_sid->SubAuthorityCount]);
aaa->Mask = FILE_ALL_ACCESS;
@@ -382,7 +382,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
aaa = (ACCESS_ALLOWED_ACE *)ace_next( current_ace );
current_ace = &aaa->Header;
aaa->Header.AceType = ACCESS_ALLOWED_ACE_TYPE;
- aaa->Header.AceFlags = 0;
+ aaa->Header.AceFlags = (mode & S_IFDIR) ? OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE : 0;
aaa->Header.AceSize = FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) +
FIELD_OFFSET(SID, SubAuthority[user->SubAuthorityCount]);
aaa->Mask = WRITE_DAC | WRITE_OWNER;
@@ -401,7 +401,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
ACCESS_DENIED_ACE *ada = (ACCESS_DENIED_ACE *)ace_next( current_ace );
current_ace = &ada->Header;
ada->Header.AceType = ACCESS_DENIED_ACE_TYPE;
- ada->Header.AceFlags = 0;
+ ada->Header.AceFlags = (mode & S_IFDIR) ? OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE : 0;
ada->Header.AceSize = FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart) +
FIELD_OFFSET(SID, SubAuthority[user->SubAuthorityCount]);
ada->Mask = 0;
@@ -419,7 +419,7 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID
aaa = (ACCESS_ALLOWED_ACE *)ace_next( current_ace );
current_ace = &aaa->Header;
aaa->Header.AceType = ACCESS_ALLOWED_ACE_TYPE;
- aaa->Header.AceFlags = 0;
+ aaa->Header.AceFlags = (mode & S_IFDIR) ? OBJECT_INHERIT_ACE | CONTAINER_INHERIT_ACE : 0;
aaa->Header.AceSize = FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) +
FIELD_OFFSET(SID, SubAuthority[world_sid->SubAuthorityCount]);
aaa->Mask = 0;
--
2.13.2
Подробная информация о списке рассылки Wine-patches