Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 2009 14:57:33 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198491 - head/sbin/mount_nfs
Message-ID:  <200910261457.n9QEvYtc093313@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Mon Oct 26 14:57:33 2009
New Revision: 198491
URL: http://svn.freebsd.org/changeset/base/198491

Log:
  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:
  head/sbin/mount_nfs/mount_nfs.c

Modified: head/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.c	Mon Oct 26 13:03:52 2009	(r198490)
+++ head/sbin/mount_nfs/mount_nfs.c	Mon Oct 26 14:57:33 2009	(r198491)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910261457.n9QEvYtc093313>