Print this page
NEX-6096 Enable compile warnings re. parentheses in smbsrv
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Jean McCormack <jean.mccormack@nexenta.com>
OS-139 POSIX write should imply DELETE_CHILD on directories - and some additional considerations
SMB-50 User-mode SMB server
 Includes work by these authors:
 Thomas Keiser <thomas.keiser@nexenta.com>
 Albert Lee <trisk@nexenta.com>


1678 
1679 /*
1680  * ace_trivial:
1681  * determine whether an ace_t acl is trivial
1682  *
1683  * Trivialness implies that the acl is composed of only
1684  * owner, group, everyone entries.  ACL can't
1685  * have read_acl denied, and write_owner/write_acl/write_attributes
1686  * can only be owner@ entry.
1687  */
1688 int
1689 ace_trivial_common(void *acep, int aclcnt,
1690     uint64_t (*walk)(void *, uint64_t, int aclcnt,
1691     uint16_t *, uint16_t *, uint32_t *))
1692 {
1693         uint16_t flags;
1694         uint32_t mask;
1695         uint16_t type;
1696         uint64_t cookie = 0;
1697 
1698         while (cookie = walk(acep, cookie, aclcnt, &flags, &type, &mask)) {

1699                 switch (flags & ACE_TYPE_FLAGS) {
1700                 case ACE_OWNER:
1701                 case ACE_GROUP|ACE_IDENTIFIER_GROUP:
1702                 case ACE_EVERYONE:
1703                         break;
1704                 default:
1705                         return (1);
1706 
1707                 }
1708 
1709                 if (flags & (ACE_FILE_INHERIT_ACE|
1710                     ACE_DIRECTORY_INHERIT_ACE|ACE_NO_PROPAGATE_INHERIT_ACE|
1711                     ACE_INHERIT_ONLY_ACE))
1712                         return (1);
1713 
1714                 /*
1715                  * Special check for some special bits
1716                  *
1717                  * Don't allow anybody to deny reading basic
1718                  * attributes or a files ACL.




1678 
1679 /*
1680  * ace_trivial:
1681  * determine whether an ace_t acl is trivial
1682  *
1683  * Trivialness implies that the acl is composed of only
1684  * owner, group, everyone entries.  ACL can't
1685  * have read_acl denied, and write_owner/write_acl/write_attributes
1686  * can only be owner@ entry.
1687  */
1688 int
1689 ace_trivial_common(void *acep, int aclcnt,
1690     uint64_t (*walk)(void *, uint64_t, int aclcnt,
1691     uint16_t *, uint16_t *, uint32_t *))
1692 {
1693         uint16_t flags;
1694         uint32_t mask;
1695         uint16_t type;
1696         uint64_t cookie = 0;
1697 
1698         while ((cookie = walk(acep, cookie, aclcnt, &flags, &type, &mask))
1699             != NULL) {
1700                 switch (flags & ACE_TYPE_FLAGS) {
1701                 case ACE_OWNER:
1702                 case ACE_GROUP|ACE_IDENTIFIER_GROUP:
1703                 case ACE_EVERYONE:
1704                         break;
1705                 default:
1706                         return (1);
1707 
1708                 }
1709 
1710                 if (flags & (ACE_FILE_INHERIT_ACE|
1711                     ACE_DIRECTORY_INHERIT_ACE|ACE_NO_PROPAGATE_INHERIT_ACE|
1712                     ACE_INHERIT_ONLY_ACE))
1713                         return (1);
1714 
1715                 /*
1716                  * Special check for some special bits
1717                  *
1718                  * Don't allow anybody to deny reading basic
1719                  * attributes or a files ACL.