[patch] mount_nfs(8) option parsing bug
Jaakko Heinonen
jh at saunalahti.fi
Mon Apr 6 10:00:42 PDT 2009
Hi,
mount_nfs(8) doesn't parse options specified with -o correctly if an
option with value is preceded by an option without value.
# mount_nfs -o rdirplus,acdirmax=0 localhost:/dir /mnt
mount_nfs: /mnt, illegal acdirmax: : Invalid argument
Possible fix:
%%%
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;
%%%
--
Jaakko
More information about the freebsd-current
mailing list