提交 1c456013 编写于 作者: J Jeff Layton 提交者: Steve French

cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid (try #7)

commit 3aa1c8c2 made cifs_getattr set
the ownership of files to current_fsuid/current_fsgid when multiuser
mounts were in use and when mnt_uid/mnt_gid were non-zero.

It should have instead based that decision on the
CIFS_MOUNT_OVERR_UID/GID flags.
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 9daa42e2
...@@ -1765,11 +1765,17 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, ...@@ -1765,11 +1765,17 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
generic_fillattr(dentry->d_inode, stat); generic_fillattr(dentry->d_inode, stat);
stat->blksize = CIFS_MAX_MSGSIZE; stat->blksize = CIFS_MAX_MSGSIZE;
stat->ino = CIFS_I(dentry->d_inode)->uniqueid; stat->ino = CIFS_I(dentry->d_inode)->uniqueid;
/*
* If on a multiuser mount without unix extensions, and the
* admin hasn't overridden them, set the ownership to the
* fsuid/fsgid of the current process.
*/
if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) && if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) &&
!tcon->unix_ext) { !tcon->unix_ext) {
if (!cifs_sb->mnt_uid) if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID))
stat->uid = current_fsuid(); stat->uid = current_fsuid();
if (!cifs_sb->mnt_uid) if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID))
stat->gid = current_fsgid(); stat->gid = current_fsgid();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册