diff options
-rw-r--r-- | fs/cifs/inode.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index f629159be4e0..94979309698a 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -1755,7 +1755,7 @@ check_inval: | |||
1755 | } | 1755 | } |
1756 | 1756 | ||
1757 | int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, | 1757 | int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, |
1758 | struct kstat *stat) | 1758 | struct kstat *stat) |
1759 | { | 1759 | { |
1760 | struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb); | 1760 | struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb); |
1761 | struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); | 1761 | struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); |
@@ -1765,11 +1765,17 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, | |||
1765 | generic_fillattr(dentry->d_inode, stat); | 1765 | generic_fillattr(dentry->d_inode, stat); |
1766 | stat->blksize = CIFS_MAX_MSGSIZE; | 1766 | stat->blksize = CIFS_MAX_MSGSIZE; |
1767 | stat->ino = CIFS_I(dentry->d_inode)->uniqueid; | 1767 | stat->ino = CIFS_I(dentry->d_inode)->uniqueid; |
1768 | |||
1769 | /* | ||
1770 | * If on a multiuser mount without unix extensions, and the | ||
1771 | * admin hasn't overridden them, set the ownership to the | ||
1772 | * fsuid/fsgid of the current process. | ||
1773 | */ | ||
1768 | if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) && | 1774 | if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) && |
1769 | !tcon->unix_ext) { | 1775 | !tcon->unix_ext) { |
1770 | if (!cifs_sb->mnt_uid) | 1776 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)) |
1771 | stat->uid = current_fsuid(); | 1777 | stat->uid = current_fsuid(); |
1772 | if (!cifs_sb->mnt_uid) | 1778 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)) |
1773 | stat->gid = current_fsgid(); | 1779 | stat->gid = current_fsgid(); |
1774 | } | 1780 | } |
1775 | } | 1781 | } |