From owner-freebsd-current@FreeBSD.ORG Mon Apr 6 17:00:41 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52EFC1065786 for ; Mon, 6 Apr 2009 17:00:41 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 15D2E8FC1A for ; Mon, 6 Apr 2009 17:00:40 +0000 (UTC) (envelope-from jh@saunalahti.fi) Received: from a91-153-125-115.elisa-laajakaista.fi (a91-153-125-115.elisa-laajakaista.fi [91.153.125.115]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id D2A58216A60 for ; Mon, 6 Apr 2009 20:00:38 +0300 (EEST) Date: Mon, 6 Apr 2009 20:00:38 +0300 From: Jaakko Heinonen To: freebsd-current@FreeBSD.org Message-ID: <20090406170038.GA4058@a91-153-125-115.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Subject: [patch] mount_nfs(8) option parsing bug X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 17:00:42 -0000 Hi, mount_nfs(8) doesn't parse options specified with -o correctly if an option with value is preceded by an option without value. # mount_nfs -o rdirplus,acdirmax=0 localhost:/dir /mnt mount_nfs: /mnt, illegal acdirmax: : Invalid argument Possible fix: %%% Index: sbin/mount_nfs/mount_nfs.c =================================================================== --- sbin/mount_nfs/mount_nfs.c (revision 190637) +++ sbin/mount_nfs/mount_nfs.c (working copy) @@ -265,16 +265,16 @@ main(int argc, char *argv[]) char *pnextopt = NULL; char *val = ""; pass_flag_to_nmount = 1; - pval = strchr(opt, '='); pnextopt = strchr(opt, ','); - if (pval != NULL) { - *pval = '\0'; - val = pval + 1; - } if (pnextopt) { *pnextopt = '\0'; pnextopt++; } + pval = strchr(opt, '='); + if (pval != NULL) { + *pval = '\0'; + val = pval + 1; + } if (strcmp(opt, "bg") == 0) { opflags |= BGRND; pass_flag_to_nmount=0; %%% -- Jaakko