diff options
author | Matthew Macy <[email protected]> | 2020-10-21 14:08:06 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-21 14:08:06 -0700 |
commit | e53d678d4ad596a310d51dab107bb6fa97e2b226 (patch) | |
tree | bf1d9167e7f4c3f0fadbc190d23eb6a1f1dc67a4 /module/os/linux/zfs/policy.c | |
parent | 666aa69f32ff2558ef9e9a27bc4cb5559e21d795 (diff) |
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 <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #11078
Diffstat (limited to 'module/os/linux/zfs/policy.c')
-rw-r--r-- | module/os/linux/zfs/policy.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/module/os/linux/zfs/policy.c b/module/os/linux/zfs/policy.c index 5267d67ee..8780d7f6c 100644 --- a/module/os/linux/zfs/policy.c +++ b/module/os/linux/zfs/policy.c @@ -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; |