Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2009 20:22:59 +0300 (EEST)
From:      Jaakko Heinonen <jh@saunalahti.fi>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/134069: [patch] mount_nfs(8) option parsing bug
Message-ID:  <200904281722.n3SHMxuw010238@ws64.jh.dy.fi>
Resent-Message-ID: <200904281750.n3SHo0Vb022341@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         134069
>Category:       bin
>Synopsis:       [patch] mount_nfs(8) option parsing bug
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 28 17:50:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Jaakko Heinonen
>Release:        FreeBSD 8.0-CURRENT
>Organization:
>Environment:
FreeBSD 8.0-CURRENT r191616

	
>Description:
mount_nfs(8) doesn't parse options specified with -o correctly if an            
option with value is preceded by an option without value.

The bug was introduced in r183008.

>How-To-Repeat:
# mount_nfs -o rdirplus,acdirmax=0 localhost:/dir /mnt                          
mount_nfs: /mnt, illegal acdirmax: : Invalid argument

>Fix:
--- mount_nfs-option-parsing.diff begins here ---
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;
--- mount_nfs-option-parsing.diff ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



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