From patchwork Mon Sep 20 23:01:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 196152 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8KN290U018281 for ; Mon, 20 Sep 2010 23:02:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754901Ab0ITXCJ (ORCPT ); Mon, 20 Sep 2010 19:02:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2428 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757813Ab0ITXCG (ORCPT ); Mon, 20 Sep 2010 19:02:06 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8KN24aW004934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 20 Sep 2010 19:02:04 -0400 Received: from corrin.poochiereds.net (ovpn-113-92.phx2.redhat.com [10.3.113.92]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8KN1bBY001599; Mon, 20 Sep 2010 19:02:03 -0400 From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 14/15] cifs: add "multiuser" mount option Date: Mon, 20 Sep 2010 16:01:43 -0700 Message-Id: <1285023704-2159-15-git-send-email-jlayton@redhat.com> In-Reply-To: <1285023704-2159-1-git-send-email-jlayton@redhat.com> References: <1285023704-2159-1-git-send-email-jlayton@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Sep 2010 23:02:10 +0000 (UTC) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 3e2b069..c980003 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -101,6 +101,7 @@ struct smb_vol { bool nostrictsync:1; /* do not force expensive SMBflush on every sync */ bool fsc:1; /* enable fscache */ bool mfsymlinks:1; /* use Minshall+French Symlinks */ + bool multiuser:1; unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; @@ -1349,6 +1350,8 @@ cifs_parse_mount_options(char *options, const char *devname, vol->fsc = true; } else if (strnicmp(data, "mfsymlinks", 10) == 0) { vol->mfsymlinks = true; + } else if (strnicmp(data, "multiuser", 8) == 0) { + vol->multiuser = true; } else printk(KERN_WARNING "CIFS: Unknown mount option %s\n", data); @@ -1380,6 +1383,13 @@ cifs_parse_mount_options(char *options, const char *devname, return 1; } } + + if (vol->multiuser && !(vol->secFlg & CIFSSEC_MAY_KRB5)) { + cERROR(1, "Multiuser mounts currently require krb5 " + "authentication!"); + return 1; + } + if (vol->UNCip == NULL) vol->UNCip = &vol->UNC[2]; @@ -2585,6 +2595,9 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; if (pvolume_info->fsc) cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_FSCACHE; + if (pvolume_info->multiuser) + cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_MULTIUSER | + 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;