From patchwork Tue Jul 27 11:42:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 114513 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6RBhICM017720 for ; Tue, 27 Jul 2010 11:43:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752131Ab0G0LnS (ORCPT ); Tue, 27 Jul 2010 07:43:18 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.122]:63205 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644Ab0G0LnR (ORCPT ); Tue, 27 Jul 2010 07:43:17 -0400 X-Authority-Analysis: v=1.1 cv=p5fb2WIJnrs7OVB5ZUhm3upz8M0Jb9gBWSAJBbXlGW4= c=1 sm=0 a=NQG4luWbQI8A:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=hGzw-44bAAAA:8 a=0qhxMXDi62KvZN9caCAA:9 a=VM1y0KWlflvSR3w6a_EA:7 a=-EoUKPOuwgORTrPIVyBgNTqG4WEA:4 a=dowx1zmaLagA: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:57313] helo=mail.poochiereds.net) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 6F/9D-00999-716CE4C4; Tue, 27 Jul 2010 11:42:15 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id DD4A458128; Tue, 27 Jul 2010 07:42:14 -0400 (EDT) From: Jeff Layton To: linux-cifs@vger.kernel.org Subject: [PATCH] mount.cifs: handle the "mand" and "nomand" mount options (try #2) Date: Tue, 27 Jul 2010 07:42:14 -0400 Message-Id: <1280230934-20830-1-git-send-email-jlayton@samba.org> X-Mailer: git-send-email 1.7.1.1 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 (demeter.kernel.org [140.211.167.41]); Tue, 27 Jul 2010 11:43:18 +0000 (UTC) diff --git a/mount.cifs.c b/mount.cifs.c index 27d267c..5a05caa 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -160,6 +160,8 @@ #define OPT_RO 24 #define OPT_RW 25 #define OPT_REMOUNT 26 +#define OPT_MAND 27 +#define OPT_NOMAND 28 /* struct for holding parsed mount info for use by privleged process */ @@ -823,6 +825,10 @@ static int parse_opt_token(const char *token) return OPT_NO_DEV; if (strncmp(token, "nobrl", 5) == 0 || strncmp(token, "nolock", 6) == 0) return OPT_NO_LOCK; + if (strncmp(token, "mand", 4) == 0) + return OPT_MAND; + if (strncmp(token, "nomand", 6) == 0) + return OPT_NOMAND; if (strncmp(token, "dev", 3) == 0) return OPT_DEV; if (strncmp(token, "noexec", 6) == 0) @@ -1109,6 +1115,12 @@ parse_options(const char *data, struct parsed_mount_info *parsed_info) case OPT_NO_LOCK: *filesys_flags &= ~MS_MANDLOCK; break; + case OPT_MAND: + *filesys_flags |= MS_MANDLOCK; + goto nocopy; + case OPT_NOMAND: + *filesys_flags &= ~MS_MANDLOCK; + goto nocopy; case OPT_DEV: *filesys_flags &= ~MS_NODEV; break; @@ -1735,8 +1747,6 @@ int main(int argc, char **argv) return EX_SYSERR; } - parsed_info->flags = MS_MANDLOCK; - /* add sharename in opts string as unc= parm */ while ((c = getopt_long(argc, argv, "?fhno:rvVw", longopts, NULL)) != -1) {