summaryrefslogtreecommitdiffstats
path: root/utils/mount/network.c
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2010-06-03 08:53:22 -0400
committerSteve Dickson <steved@redhat.com>2010-06-22 09:52:51 -0400
commit9ac7a15017b876d4d8d3a4502ebaf954f36f7f54 (patch)
treec7b81ec1620ea5f892582719ca72a805d0975079 /utils/mount/network.c
parent740171dea45a57e396a86fbda1579a465f101854 (diff)
downloadnfs-utils-9ac7a15017b876d4d8d3a4502ebaf954f36f7f54.tar.gz
nfs-utils-9ac7a15017b876d4d8d3a4502ebaf954f36f7f54.tar.xz
nfs-utils-9ac7a15017b876d4d8d3a4502ebaf954f36f7f54.zip
mount.nfs: silently fails when the network protocol is not found
mount.nfs should display some type of error diagnostics when the network protocol can not be determined. Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/network.c')
-rw-r--r--utils/mount/network.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c
index d9903ed..ffb18ab 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -1311,6 +1311,8 @@ nfs_nfs_protocol(struct mount_options *options, unsigned long *protocol)
if (option != NULL) {
if (!nfs_get_proto(option, &family, protocol)) {
errno = EPROTONOSUPPORT;
+ nfs_error(_("%s: Failed to find '%s' protocol"),
+ progname, option);
return 0;
}
return 1;
@@ -1399,8 +1401,13 @@ int nfs_nfs_proto_family(struct mount_options *options,
case 2: /* proto */
option = po_get(options, "proto");
if (option != NULL &&
- !nfs_get_proto(option, &tmp_family, &protocol))
- goto out_err;
+ !nfs_get_proto(option, &tmp_family, &protocol)) {
+
+ nfs_error(_("%s: Failed to find '%s' protocol"),
+ progname, option);
+ errno = EPROTONOSUPPORT;
+ return 0;
+ }
}
if (!nfs_verify_family(tmp_family))
@@ -1492,6 +1499,8 @@ nfs_mount_protocol(struct mount_options *options, unsigned long *protocol)
if (option != NULL) {
if (!nfs_get_proto(option, &family, protocol)) {
errno = EPROTONOSUPPORT;
+ nfs_error(_("%s: Failed to find '%s' protocol"),
+ progname, option);
return 0;
}
return 1;
@@ -1551,8 +1560,12 @@ int nfs_mount_proto_family(struct mount_options *options,
option = po_get(options, "mountproto");
if (option != NULL) {
- if (!nfs_get_proto(option, &tmp_family, &protocol))
+ if (!nfs_get_proto(option, &tmp_family, &protocol)) {
+ nfs_error(_("%s: Failed to find '%s' protocol"),
+ progname, option);
+ errno = EPROTONOSUPPORT;
goto out_err;
+ }
if (!nfs_verify_family(tmp_family))
goto out_err;
*family = tmp_family;