mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 22:33:39 +00:00
Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK,
sunlnk) flag is set. We only deny dirctory's removal or rename. PR: kern/143343 Reported by: marck MFC after: 3 days
This commit is contained in:
parent
2ee6488c02
commit
7af9c09a61
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207068
|
@ -2235,11 +2235,24 @@ zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint32_t *working_mode,
|
|||
return (EPERM);
|
||||
}
|
||||
|
||||
#ifdef sun
|
||||
if ((v4_mode & (ACE_DELETE | ACE_DELETE_CHILD)) &&
|
||||
(zp->z_phys->zp_flags & ZFS_NOUNLINK)) {
|
||||
*check_privs = B_FALSE;
|
||||
return (EPERM);
|
||||
}
|
||||
#else
|
||||
/*
|
||||
* In FreeBSD we allow to modify directory's content is ZFS_NOUNLINK
|
||||
* (sunlnk) is set. We just don't allow directory removal, which is
|
||||
* handled in zfs_zaccess_delete().
|
||||
*/
|
||||
if ((v4_mode & ACE_DELETE) &&
|
||||
(zp->z_phys->zp_flags & ZFS_NOUNLINK)) {
|
||||
*check_privs = B_FALSE;
|
||||
return (EPERM);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (((v4_mode & (ACE_READ_DATA|ACE_EXECUTE)) &&
|
||||
(zp->z_phys->zp_flags & ZFS_AV_QUARANTINED))) {
|
||||
|
|
Loading…
Reference in a new issue