mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Don't fail to apply umask for O_TMPFILE files
Apply umask to `mode` which will eventually be applied to inode. This is needed since VFS doesn't apply umask for O_TMPFILE files. (Note that zpl_init_acl() applies `ip->i_mode &= ~current_umask();` only when POSIX ACL is used.) Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com> Closes #8997 Closes #8998
This commit is contained in:
committed by
Tony Hutter
parent
7ad0ae91d5
commit
6455859ee7
@@ -226,6 +226,12 @@ zpl_tmpfile(struct inode *dir, struct dentry *dentry, zpl_umode_t mode)
|
||||
|
||||
crhold(cr);
|
||||
vap = kmem_zalloc(sizeof (vattr_t), KM_SLEEP);
|
||||
/*
|
||||
* The VFS does not apply the umask, therefore it is applied here
|
||||
* when POSIX ACLs are not enabled.
|
||||
*/
|
||||
if (!IS_POSIXACL(dir))
|
||||
mode &= ~current_umask();
|
||||
zpl_vap_init(vap, dir, mode, cr);
|
||||
|
||||
cookie = spl_fstrans_mark();
|
||||
|
||||
Reference in New Issue
Block a user