From patchwork Mon Aug 3 18:34:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 30645 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 bilbo.ozlabs.org (Postfix) with ESMTP id E3E84B6F1F for ; Tue, 4 Aug 2009 04:34:23 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 3F536ACF4C; Mon, 3 Aug 2009 12:30:56 -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.0 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.120]) by lists.samba.org (Postfix) with ESMTP id 1BCE0ACF02 for ; Mon, 3 Aug 2009 12:30:50 -0600 (MDT) Received: from mail.poochiereds.net ([71.70.153.3]) by cdptpa-omta03.mail.rr.com with ESMTP id <20090803183416587.SZRZ24863@cdptpa-omta03.mail.rr.com>; Mon, 3 Aug 2009 18:34:16 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 49E7458137; Mon, 3 Aug 2009 14:34:16 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Date: Mon, 3 Aug 2009 14:34:16 -0400 Message-Id: <1249324456-8194-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.6.0.6 Cc: linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] [PATCH] cifs: send real uid of initiating process to upcall instead of mount uid 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 The ownership of files on the mount has no direct relationship to the credentials used to do the mount. Instead of sending the uid corresponding to the owner of files on the mount, instead send the real uid of the process that initiated the upcall. Usually this will be the real uid of the process running /bin/mount. Eventually however, we want to be able to establish new sessions for users that walk into a cifs mount. For that we need the real uid of those users. Signed-off-by: Jeff Layton --- fs/cifs/cifs_spnego.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c index 8ec7736..1d0d8fc 100644 --- a/fs/cifs/cifs_spnego.c +++ b/fs/cifs/cifs_spnego.c @@ -140,7 +140,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo) goto out; dp = description + strlen(description); - sprintf(dp, ";uid=0x%x", sesInfo->linux_uid); + sprintf(dp, ";uid=0x%x", current_uid()); dp = description + strlen(description); sprintf(dp, ";user=%s", sesInfo->userName);