svn commit: r199840 - stable/8/sbin/mount_nfs
Jaakko Heinonen
jh at FreeBSD.org
Thu Nov 26 18:14:03 UTC 2009
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;
More information about the svn-src-stable
mailing list