From patchwork Fri Oct 19 12:20:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 1618291 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8D9643FC1A for ; Fri, 19 Oct 2012 12:21:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757460Ab2JSMVG (ORCPT ); Fri, 19 Oct 2012 08:21:06 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:36388 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754045Ab2JSMVF (ORCPT ); Fri, 19 Oct 2012 08:21:05 -0400 Received: by mail-gh0-f174.google.com with SMTP id g15so44654ghb.19 for ; Fri, 19 Oct 2012 05:21:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=58bZyc0DL/tcv1cjj/jW4ge0WkYyv+w8GrwezWuRBvU=; b=P3ieUKpgpGDcudX2vMzGREGO/evCWjdb+fA8hI9xMo6vbrhAydBX3PYhmYpu2Zdc2S Dg3wqAHZx/OxO+EGkzHkEpuNLoDfj/rmAJ3LyyJlHwSOOyeFzEZh7iZa57KpKDM7JBqo k+1EM3KlS6k1GyzmYiVyIZjZHDB4vMqfMk9piKbpNtpznx8DGJYhcQDihlXIoX5A9ecl 1PF2nz1kRR7uBkFX0JIZ8op8BTlVpjCk9iqq2TltX8ZAjIj06Q5/Y83zhde06n481ONb qmjLFde3yS615bY2Yce5B/rZkkAJ4bdDCCYFcNZ57SR4P2FvwrP41skukDKifxeNeMvZ uPWA== Received: by 10.236.54.138 with SMTP id i10mr909180yhc.23.1350649264732; Fri, 19 Oct 2012 05:21:04 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-107-015-110-129.nc.res.rr.com. [107.15.110.129]) by mx.google.com with ESMTPS id o9sm504022anp.14.2012.10.19.05.21.03 (version=SSLv3 cipher=OTHER); Fri, 19 Oct 2012 05:21:04 -0700 (PDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH v2 7/9] cifs: don't override the uid/gid in getattr when cifsacl is enabled Date: Fri, 19 Oct 2012 08:20:48 -0400 Message-Id: <1350649250-5343-8-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1350649250-5343-1-git-send-email-jlayton@redhat.com> References: <1350649250-5343-1-git-send-email-jlayton@redhat.com> X-Gm-Message-State: ALoCoQmD3SfsJZwmLRHlffckg2Txu59pA8biPSvEBOtU4hhI473M4sS3qwPXIlxxRqp63f0+k/j5 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org If we're using cifsacl, then we don't want to override the uid/gid with the current uid/gid, since that would prevent you from being able to upcall for this info. Signed-off-by: Jeff Layton --- fs/cifs/inode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index afdff79..ed6208f 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1791,11 +1791,12 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry, stat->ino = CIFS_I(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 on a multiuser mount without unix extensions or cifsacl being + * enabled, 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) && + !(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) && !tcon->unix_ext) { if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID)) stat->uid = current_fsuid();