diff options
author | Chunwei Chen <[email protected]> | 2016-06-17 17:36:01 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-06-21 09:58:37 -0700 |
commit | 100a91aa3e9773f2a2a373c5cb066b52c780716c (patch) | |
tree | ff7039d9e5fc5eda2f481f4bd60fcd0ad6cc2d39 /module/zfs/zfs_acl.c | |
parent | ab9f4b0b824ab4cc64a4fa382c037f4154de12d6 (diff) |
Fix NFS credential
The commit f74b821 caused a regression where creating file through NFS will
always create a file owned by root. This is because the patch enables the KSID
code in zfs_acl_ids_create, which it would use euid and egid of the current
process. However, on Linux, we should use fsuid and fsgid for file operations,
which is the original behaviour. So we revert this part of code.
The patch also enables secpolicy_vnode_*, since they are also used in file
operations, we change them to use fsuid and fsgid.
Signed-off-by: Chunwei Chen <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4772
Closes #4758
Diffstat (limited to 'module/zfs/zfs_acl.c')
-rw-r--r-- | module/zfs/zfs_acl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/zfs_acl.c b/module/zfs/zfs_acl.c index 69a93a8b6..961083d4a 100644 --- a/module/zfs/zfs_acl.c +++ b/module/zfs/zfs_acl.c @@ -1744,7 +1744,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *vap, cred_t *cr, int error; zfs_sb_t *zsb = ZTOZSB(dzp); zfs_acl_t *paclp; - gid_t gid; + gid_t gid = vap->va_gid; boolean_t need_chmod = B_TRUE; boolean_t inherited = B_FALSE; @@ -1758,6 +1758,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *vap, cred_t *cr, acl_ids->z_fuid = vap->va_uid; acl_ids->z_fgid = vap->va_gid; +#ifdef HAVE_KSID /* * Determine uid and gid. */ @@ -1809,6 +1810,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *vap, cred_t *cr, } } } +#endif /* HAVE_KSID */ /* * If we're creating a directory, and the parent directory has the |