Fix ZFS_READONLY implementation on Linux (#121)
MS-FSCC 2.6 is the governing document for DOS attribute behavior. It specifies the following: For a file, applications can read the file but cannot write to it or delete it. For a directory, applications cannot delete it, but applications can create and delete files from the directory. Signed-off-by: Andrew Walker <awalker@ixsystems.com>
This commit is contained in:
parent
2df4032585
commit
815f61fda7
|
@ -2620,7 +2620,7 @@ zfs_zaccess_common(znode_t *zp, uint32_t v4_mode, uint32_t *working_mode,
|
||||||
* Also note: DOS R/O is ignored for directories.
|
* Also note: DOS R/O is ignored for directories.
|
||||||
*/
|
*/
|
||||||
if ((v4_mode & WRITE_MASK_DATA) &&
|
if ((v4_mode & WRITE_MASK_DATA) &&
|
||||||
S_ISDIR(ZTOI(zp)->i_mode) &&
|
!S_ISDIR(ZTOI(zp)->i_mode) &&
|
||||||
(zp->z_pflags & ZFS_READONLY)) {
|
(zp->z_pflags & ZFS_READONLY)) {
|
||||||
return (SET_ERROR(EPERM));
|
return (SET_ERROR(EPERM));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1998,10 +1998,7 @@ zfs_setattr(znode_t *zp, vattr_t *vap, int flags, cred_t *cr, zidmap_t *mnt_ns)
|
||||||
goto out3;
|
goto out3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mask & ATTR_SIZE) && (zp->z_pflags & ZFS_READONLY)) {
|
/* ZFS_READONLY will be handled in zfs_zaccess() */
|
||||||
err = SET_ERROR(EPERM);
|
|
||||||
goto out3;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Verify timestamps doesn't overflow 32 bits.
|
* Verify timestamps doesn't overflow 32 bits.
|
||||||
|
|
Loading…
Reference in New Issue