mount.nfs: mounts fail when invalid versions are specified
Subsystems (2)
PATCH 1/1 mount.nfs: mounts fail when invalid versions are specified
When mount options like -o nfsvers=5 or -o v5 call the mount to silently fail. This patch adds verbosity to those types of failures.
Signed-off-by Steve Dickson <[email protected]>
--- utils/mount/network.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
utils/mount/network.c +8 -0
@@ -1235,6 +1235,10 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)long tmp;switch (po_rightmost (options, nfs_version_opttbl)) { +case -1 :/* invalid value */ +nfs_error (_ ("%s: invalid mount option was specified" ), + progname); +return 0 ;case 0 :/* v2 */ *version =2 ;return 1 ;
@@ -1251,6 +1255,8 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version) *version = tmp;return 1 ; } +nfs_error (_ ("%s: invalid value for 'vers=' option" ), + progname);return 0 ;case PO_NOT_FOUND : nfs_error(_("%s: parsing error on 'vers=' option\n"),
@@ -1268,6 +1274,8 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version) *version = tmp;return 1 ; } +nfs_error (_ ("%s: invalid value for 'nfsvers=' option" ), + progname);return 0 ;case PO_NOT_FOUND : nfs_error(_("%s: parsing error on 'nfsvers=' option\n"),
Signature · 1 line
1.7.6