Prevent zfs_acl_chmod() if aclmode restricted and ACL inherited
In absence of inheriting entry for owner@, group@, or everyone@, zfs_acl_chmod() is called to set these. This can cause confusion for Samba admins who do not expect these entries to appear on newly created files and directories once they have been stripped from from the parent directory. When aclmode is set to "restricted", chmod is prevented on non-trivial ACLs. It is not a stretch to assume that in this case the administrator does not want ZFS to add the missing special entries. Add check for this aclmode, and if an inherited entry is present skip zfs_acl_chmod(). Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Andrew Walker <awalker@ixsystems.com> Closes #10748
This commit is contained in:
parent
ab4a78c744
commit
a741b386d3
|
@ -1598,6 +1598,10 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_acl_t *paclp,
|
||||||
newflags|ACE_INHERITED_ACE);
|
newflags|ACE_INHERITED_ACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (zfsvfs->z_acl_mode == ZFS_ACL_RESTRICTED &&
|
||||||
|
aclp->z_acl_count != 0) {
|
||||||
|
*need_chmod = B_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return (aclp);
|
return (aclp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1766,6 +1766,10 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, umode_t va_mode, zfs_acl_t *paclp,
|
||||||
newflags|ACE_INHERITED_ACE);
|
newflags|ACE_INHERITED_ACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (zfsvfs->z_acl_mode == ZFS_ACL_RESTRICTED &&
|
||||||
|
aclp->z_acl_count != 0) {
|
||||||
|
*need_chmod = B_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return (aclp);
|
return (aclp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue