summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorjh <jh@FreeBSD.org>2009-11-26 18:14:03 +0000
committerjh <jh@FreeBSD.org>2009-11-26 18:14:03 +0000
commite428a4402d682a40baeb133a0adfcd53d8f7994b (patch)
tree92709b6ed85e9b0914c77114ced0bca3c5233b93 /sbin
parent65b3bbf3846fd747025cd0d92dc564623301bcf9 (diff)
downloadFreeBSD-src-e428a4402d682a40baeb133a0adfcd53d8f7994b.zip
FreeBSD-src-e428a4402d682a40baeb133a0adfcd53d8f7994b.tar.gz
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)
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount_nfs/mount_nfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 7d4f3f6..229da14 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -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;
OpenPOWER on IntegriCloud