[PATCH 1/2] mount.nfs: silently fails with bad version arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



mount.nfs should not only fail when an invalid protocol
option is used (as it does), it should also print a
diagnostic identifying the problem.

Signed-off-by: Steve Dickson <steved@xxxxxxxxxx>
---
 utils/mount/network.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index c541257..de1014d 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -1254,6 +1254,8 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
 			nfs_error(_("%s: option parsing error\n"),
 					progname);
 		case PO_BAD_VALUE:
+			nfs_error(_("%s: invalid value for 'vers=' option"),
+					progname);
 			return 0;
 		}
 	case 4: /* nfsvers */
@@ -1268,6 +1270,8 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
 			nfs_error(_("%s: option parsing error\n"),
 					progname);
 		case PO_BAD_VALUE:
+			nfs_error(_("%s: invalid value for 'nfsvers=' option"),
+					progname);
 			return 0;
 		}
 	}
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux