From patchwork Fri Aug 20 19:32:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 120688 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7KJc1uH021287 for ; Fri, 20 Aug 2010 19:38:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753616Ab0HTTiA (ORCPT ); Fri, 20 Aug 2010 15:38:00 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.121]:58351 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751616Ab0HTTiA (ORCPT ); Fri, 20 Aug 2010 15:38:00 -0400 X-Authority-Analysis: v=1.0 c=1 a=HbaZAxvtrXoA:10 a=20KFwNOVAAAA:8 a=HlLpM_0dOuqEeWx6vLgA:9 a=AQkSND3vd_iJuHeKqkoA:7 a=IOUyvUr6yc_-s3TcruXXd53tXVkA:4 a=jEp0ucaQiEUA:10 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:44032] helo=mail.poochiereds.net) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 4C/2A-18150-799DE6C4; Fri, 20 Aug 2010 19:37:59 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 2F18558156; Fri, 20 Aug 2010 15:32:12 -0400 (EDT) From: Jeff Layton To: linux-cifs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH 14/15] cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid Date: Fri, 20 Aug 2010 15:32:10 -0400 Message-Id: <1282332731-17444-15-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.2.1 In-Reply-To: <1282332731-17444-1-git-send-email-jlayton@redhat.com> References: <1282332731-17444-1-git-send-email-jlayton@redhat.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 20 Aug 2010 19:38:01 +0000 (UTC) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 026d7dd..d52ca4a 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1747,11 +1747,19 @@ check_inval: int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) { + struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb); + struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); int err = cifs_revalidate_dentry(dentry); + if (!err) { generic_fillattr(dentry->d_inode, stat); stat->blksize = CIFS_MAX_MSGSIZE; stat->ino = CIFS_I(dentry->d_inode)->uniqueid; + if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER && + !tcon->unix_ext) { + stat->uid = current_fsuid(); + stat->gid = current_fsgid(); + } } return err; }