From owner-svn-src-stable@FreeBSD.ORG Thu Nov 26 18:14:03 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1C431065672; Thu, 26 Nov 2009 18:14:03 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE3F8FC0A; Thu, 26 Nov 2009 18:14:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAQIE3GM089432; Thu, 26 Nov 2009 18:14:03 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAQIE3Z2089430; Thu, 26 Nov 2009 18:14:03 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200911261814.nAQIE3Z2089430@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 26 Nov 2009 18:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199840 - stable/8/sbin/mount_nfs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2009 18:14:03 -0000 Author: jh Date: Thu Nov 26 18:14:03 2009 New Revision: 199840 URL: http://svn.freebsd.org/changeset/base/199840 Log: MFC r198491: Fix parsing of mount options specified with -o in case an option with value is preceded by an option without value (for example -o option1,option2=value). Options must be separated before searching for '='. Also compare pnextopt explicitly against NULL. PR: bin/134069 Approved by: trasz (mentor) Modified: stable/8/sbin/mount_nfs/mount_nfs.c Directory Properties: stable/8/sbin/mount_nfs/ (props changed) Modified: stable/8/sbin/mount_nfs/mount_nfs.c ============================================================================== --- stable/8/sbin/mount_nfs/mount_nfs.c Thu Nov 26 15:50:52 2009 (r199839) +++ stable/8/sbin/mount_nfs/mount_nfs.c Thu Nov 26 18:14:03 2009 (r199840) @@ -232,16 +232,16 @@ main(int argc, char *argv[]) char *pnextopt = NULL; char *val = ""; pass_flag_to_nmount = 1; - pval = strchr(opt, '='); pnextopt = strchr(opt, ','); + if (pnextopt != NULL) { + *pnextopt = '\0'; + pnextopt++; + } + pval = strchr(opt, '='); if (pval != NULL) { *pval = '\0'; val = pval + 1; } - if (pnextopt) { - *pnextopt = '\0'; - pnextopt++; - } if (strcmp(opt, "bg") == 0) { opflags |= BGRND; pass_flag_to_nmount=0;