From patchwork Tue Apr 20 20:07:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 50566 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id CEDB4B7D15 for ; Wed, 21 Apr 2010 06:07:42 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 2FAC4465CA; Tue, 20 Apr 2010 14:07:43 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=3.8 tests=AWL, BAYES_00, NO_MORE_FUNN, SPF_PASS autolearn=no version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.121]) by lists.samba.org (Postfix) with ESMTP id DF279AD26C for ; Tue, 20 Apr 2010 14:07:23 -0600 (MDT) X-Authority-Analysis: v=1.1 cv=ozfpW0B87ixv+y7a1W07/YoomWMeieABhgxoD9XXnPM= c=1 sm=0 a=Wxu6IDECZDkA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=HlLpM_0dOuqEeWx6vLgA:9 a=AQkSND3vd_iJuHeKqkoA:7 a=cPaejNmWWwoXXy2ttlI0sxtCGKEA:4 a=jEp0ucaQiEUA:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:45271] helo=mail.poochiereds.net) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id D3/BA-25246-A790ECB4; Tue, 20 Apr 2010 20:07:22 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id E0AFE5809C; Tue, 20 Apr 2010 16:07:20 -0400 (EDT) From: Jeff Layton To: linux-cifs-client@lists.samba.org, linux-fsdevel@vger.kernel.org Date: Tue, 20 Apr 2010 16:07:18 -0400 Message-Id: <1271794039-22787-11-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1271794039-22787-1-git-send-email-jlayton@redhat.com> References: <1271794039-22787-1-git-send-email-jlayton@redhat.com> Cc: smfrench@gmail.com Subject: [linux-cifs-client] [PATCH 10/11] cifs: on multises mount, set ownership to current_fsuid/current_fsgid X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org ...when unix extensions aren't enabled. This makes everything on the mount appear to be owned by the current user. Signed-off-by: Jeff Layton --- fs/cifs/inode.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 100ad85..d425d08 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1661,11 +1661,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_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_MULTISES && + !tcon->unix_ext) { + stat->uid = current_fsuid(); + stat->gid = current_fsgid(); + } } return err; }