summaryrefslogtreecommitdiffstats
path: root/utils/mount/network.c
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2010-06-03 08:32:56 -0400
committerSteve Dickson <steved@redhat.com>2010-06-22 09:52:43 -0400
commit740171dea45a57e396a86fbda1579a465f101854 (patch)
treecf28071f22cc1645b77ab05b689c33df6010756d /utils/mount/network.c
parent94c3d7c91de582cf29ff9100950ecd4a5fd1606b (diff)
downloadnfs-utils-740171dea45a57e396a86fbda1579a465f101854.tar.gz
nfs-utils-740171dea45a57e396a86fbda1579a465f101854.tar.xz
nfs-utils-740171dea45a57e396a86fbda1579a465f101854.zip
mount: silently fails when bad option values are given
mount.nfs should not only fail when an invalid option values are supplied (as it does), it should also print a diagnostic message identifying the problem Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/network.c')
-rw-r--r--utils/mount/network.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c
index c541257..d9903ed 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -1212,6 +1212,8 @@ nfs_nfs_program(struct mount_options *options, unsigned long *program)
return 1;
}
case PO_BAD_VALUE:
+ nfs_error(_("%s: invalid value for 'nfsprog=' option"),
+ progname);
return 0;
}
@@ -1251,9 +1253,12 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
}
return 0;
case PO_NOT_FOUND:
- nfs_error(_("%s: option parsing error\n"),
+ nfs_error(_("%s: parsing error on 'vers=' option\n"),
progname);
+ return 0;
case PO_BAD_VALUE:
+ nfs_error(_("%s: invalid value for 'vers=' option"),
+ progname);
return 0;
}
case 4: /* nfsvers */
@@ -1265,9 +1270,12 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
}
return 0;
case PO_NOT_FOUND:
- nfs_error(_("%s: option parsing error\n"),
+ nfs_error(_("%s: parsing error on 'nfsvers=' option\n"),
progname);
+ return 0;
case PO_BAD_VALUE:
+ nfs_error(_("%s: invalid value for 'nfsvers=' option"),
+ progname);
return 0;
}
}
@@ -1336,6 +1344,8 @@ nfs_nfs_port(struct mount_options *options, unsigned long *port)
return 1;
}
case PO_BAD_VALUE:
+ nfs_error(_("%s: invalid value for 'port=' option"),
+ progname);
return 0;
}
@@ -1423,6 +1433,8 @@ nfs_mount_program(struct mount_options *options, unsigned long *program)
return 1;
}
case PO_BAD_VALUE:
+ nfs_error(_("%s: invalid value for 'mountprog=' option"),
+ progname);
return 0;
}
@@ -1452,6 +1464,8 @@ nfs_mount_version(struct mount_options *options, unsigned long *version)
return 1;
}
case PO_BAD_VALUE:
+ nfs_error(_("%s: invalid value for 'mountvers=' option"),
+ progname);
return 0;
}
@@ -1510,6 +1524,8 @@ nfs_mount_port(struct mount_options *options, unsigned long *port)
return 1;
}
case PO_BAD_VALUE:
+ nfs_error(_("%s: invalid value for 'mountport=' option"),
+ progname);
return 0;
}