From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Layton Subject: [PATCH 11/11] cifs: add "multises" mount option Date: Tue, 20 Apr 2010 16:07:19 -0400 Message-ID: <1271794039-22787-12-git-send-email-jlayton@redhat.com> References: <1271794039-22787-1-git-send-email-jlayton@redhat.com> Cc: obnox@samba.org, smfrench@gmail.com To: linux-cifs-client@lists.samba.org, linux-fsdevel@vger.kernel.org Return-path: Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.122]:33014 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754805Ab0DTUI4 (ORCPT ); Tue, 20 Apr 2010 16:08:56 -0400 In-Reply-To: <1271794039-22787-1-git-send-email-jlayton@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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; -- 1.6.6.1