* security.cc (alloc_sd): For directories, mark inherited ACEs

inheritable to better follow POSIX 1003.1e rules.
This commit is contained in:
Corinna Vinschen 2015-02-27 15:54:15 +00:00
parent 83b0e8cffe
commit 9f6688dfc5
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2015-02-27 Corinna Vinschen <corinna@vinschen.de>
* security.cc (alloc_sd): For directories, mark inherited ACEs
inheritable to better follow POSIX 1003.1e rules.
2015-02-27 Corinna Vinschen <corinna@vinschen.de>
* sec_acl.cc (getacl): Add mask even if all group and secondary account

View File

@ -792,6 +792,12 @@ alloc_sd (path_conv &pc, uid_t uid, gid_t gid, int attribute,
opening a file's security tab. Explorer complains if
inheritable ACEs are preceding non-inheritable ACEs. */
ace->Header.AceFlags &= ~INHERITED_ACE;
/* However, if the newly created object is a directory,
it inherits the default ACL from its parent, so mark
all unrelated, inherited ACEs inheritable. */
if (S_ISDIR (attribute))
ace->Header.AceFlags |= CONTAINER_INHERIT_ACE
| OBJECT_INHERIT_ACE;
}
else if (uid == ILLEGAL_UID && gid == ILLEGAL_UID
&& ace->Header.AceType == ACCESS_ALLOWED_ACE_TYPE