From 06c70223082da82461e906443da9b36741bd2f5e Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Tue, 12 Oct 2010 11:32:42 -0400 Subject: [PATCH] --- yaml --- r: 213425 b: refs/heads/master c: 1c456013e96f10915578dc61095d19b4906f64ac h: refs/heads/master i: 213423: c4c9a7a9e60897c7fc3f019a7e72d5b72099bf7c v: v3 --- [refs] | 2 +- trunk/fs/cifs/inode.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index c8a99e517406..db89ecb96c78 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9daa42e22030f0c5c357a5e1f8af658411beda6b +refs/heads/master: 1c456013e96f10915578dc61095d19b4906f64ac diff --git a/trunk/fs/cifs/inode.c b/trunk/fs/cifs/inode.c index f629159be4e0..94979309698a 100644 --- a/trunk/fs/cifs/inode.c +++ b/trunk/fs/cifs/inode.c @@ -1755,7 +1755,7 @@ int cifs_revalidate_dentry(struct dentry *dentry) } int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, - struct kstat *stat) + struct kstat *stat) { struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb); struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); @@ -1765,11 +1765,17 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, generic_fillattr(dentry->d_inode, stat); stat->blksize = CIFS_MAX_MSGSIZE; 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) && !tcon->unix_ext) { - if (!cifs_sb->mnt_uid) + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)) stat->uid = current_fsuid(); - if (!cifs_sb->mnt_uid) + if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID)) stat->gid = current_fsgid(); } }