From patchwork Tue Apr 20 20:07:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 50571 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 70019B6ED0 for ; Wed, 21 Apr 2010 06:09:04 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id C34A1465BB; Tue, 20 Apr 2010 14:09:04 -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 9AA80AD24C for ; Tue, 20 Apr 2010 14:08:57 -0600 (MDT) X-Authority-Analysis: v=1.1 cv=md/akEhvz0WLrAyymQvjuC2fNr9yfI3VSI4dGos2zUA= c=1 sm=0 a=fHd92Ct9M9sA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=hw8s5t70zpn68_GM1jcA:9 a=6YUigYPkCV2QiykSHoUA:7 a=QmPYGGyU20EybSYmdUxoLVXI9tsA: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:45296] helo=mail.poochiereds.net) by cdptpa-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 3C/49-24090-8D90ECB4; Tue, 20 Apr 2010 20:08:56 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 045335809D; 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:19 -0400 Message-Id: <1271794039-22787-12-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 11/11] cifs: add "multises" mount option 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 This allows someone to declare a mount as multisession mount. Multisession mounts also imply "noperm" since we want to allow the server to handle permission checking. It also (for now) requires Kerberos authentication. Eventually, we could expand this to other authtypes, but that requires a scheme to allow per-user credential stashing in some form. Signed-off-by: Jeff Layton --- fs/cifs/connect.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index bc408ad..75b49f5 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -98,6 +98,7 @@ struct smb_vol { bool noblocksnd:1; bool noautotune:1; bool nostrictsync:1; /* do not force expensive SMBflush on every sync */ + bool multises:1; unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; @@ -1338,6 +1339,8 @@ cifs_parse_mount_options(char *options, const char *devname, printk(KERN_WARNING "CIFS: Mount option noac not " "supported. Instead set " "/proc/fs/cifs/LookupCacheEnabled to 0\n"); + } else if (strnicmp(data, "multises", 8) == 0) { + vol->multises = true; } else printk(KERN_WARNING "CIFS: Unknown mount option %s\n", data); @@ -1369,6 +1372,13 @@ cifs_parse_mount_options(char *options, const char *devname, return 1; } } + + if (vol->multises && vol->sectype != Kerberos) { + cERROR(1, ("Multisession mounts currently require krb5 " + "authentication!")); + return 1; + } + if (vol->UNCip == NULL) vol->UNCip = &vol->UNC[2]; @@ -2579,6 +2589,9 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; if (pvolume_info->dynperm) cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; + if (pvolume_info->multises) + cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_MULTISES | + CIFS_MOUNT_NO_PERM); if (pvolume_info->direct_io) { cFYI(1, ("mounting share using direct i/o")); cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;