mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD
The zfs_fsync, zfs_read, and zfs_write function are almost identical between Linux and FreeBSD. With a little refactoring they can be moved to the common code which is what is done by this commit. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #11078
This commit is contained in:
@@ -204,7 +204,8 @@ secpolicy_vnode_setdac(const cred_t *cr, uid_t owner)
|
||||
* Enforced in the Linux VFS.
|
||||
*/
|
||||
int
|
||||
secpolicy_vnode_setid_retain(const cred_t *cr, boolean_t issuidroot)
|
||||
secpolicy_vnode_setid_retain(struct znode *zp __maybe_unused, const cred_t *cr,
|
||||
boolean_t issuidroot)
|
||||
{
|
||||
return (priv_policy_user(cr, CAP_FSETID, EPERM));
|
||||
}
|
||||
@@ -271,7 +272,7 @@ void
|
||||
secpolicy_setid_clear(vattr_t *vap, cred_t *cr)
|
||||
{
|
||||
if ((vap->va_mode & (S_ISUID | S_ISGID)) != 0 &&
|
||||
secpolicy_vnode_setid_retain(cr,
|
||||
secpolicy_vnode_setid_retain(NULL, cr,
|
||||
(vap->va_mode & S_ISUID) != 0 &&
|
||||
(vap->va_mask & AT_UID) != 0 && vap->va_uid == 0) != 0) {
|
||||
vap->va_mask |= AT_MODE;
|
||||
|
||||
Reference in New Issue
Block a user