summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-11-16 12:53:01 -0500
committerSteve Dickson <steved@redhat.com>2009-11-16 12:53:01 -0500
commit2498a68b1bec01d0ee8a63962b314140e8289036 (patch)
tree122114928e6b0a6ccd4a0a91594c5f15f2c53cb4
parentdd31301d485b4244b1b35049f6917df907997da9 (diff)
downloadnfs-utils-2498a68b1bec01d0ee8a63962b314140e8289036.tar.gz
nfs-utils-2498a68b1bec01d0ee8a63962b314140e8289036.tar.xz
nfs-utils-2498a68b1bec01d0ee8a63962b314140e8289036.zip
mount.nfs: Assume v2/v3 if mount-related options are present
Don't try NFSv4 if any MNT protocol related options were presented by the user. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--utils/mount/stropts.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index b595649..a0b9e7f 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -611,6 +611,18 @@ static int nfs_try_mount_v4(struct nfsmount_info *mi)
}
if (mi->version == 0) {
+ if (po_contains(options, "mounthost") ||
+ po_contains(options, "mountaddr") ||
+ po_contains(options, "mountvers") ||
+ po_contains(options, "mountproto")) {
+ /*
+ * Since these mountd options are set assume version 3
+ * is wanted so error out with EPROTONOSUPPORT so the
+ * protocol negation starts with v3.
+ */
+ errno = EPROTONOSUPPORT;
+ goto out_fail;
+ }
if (po_append(options, "vers=4") == PO_FAILED) {
errno = EINVAL;
goto out_fail;