X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnfsmount.c;h=6c0c3655b5c23768825c812fc99b13cf043712ec;hp=d1d43c661e41555eb7ea6aa0448f69e5c8ffefb4;hb=7d9dcf303b30aeb8b3dc06616d42a8abbdc61b27;hpb=ab26cd622e1a5ef22be2df1f3176158b1505df30 diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c index d1d43c6..6c0c365 100644 --- a/utils/mount/nfsmount.c +++ b/utils/mount/nfsmount.c @@ -479,7 +479,7 @@ static int nfsmnt_check_compat(const struct pmap *nfs_pmap, } if (mnt_pmap->pm_vers > max_mnt_vers) { - nfs_error(_("%s: NFS mount version %ld s not supported"), + nfs_error(_("%s: NFS mount version %ld is not supported"), progname, mnt_pmap->pm_vers); goto out_bad; } @@ -738,7 +738,7 @@ nfsmount(const char *spec, const char *node, int flags, #if NFS_MOUNT_VERSION >= 4 mountres3_ok *mountres; fhandle3 *fhandle; - int i, *flavor, yum = 0; + int i, n_flavors, *flavor, yum = 0; if (mntres.nfsv3.fhs_status != 0) { nfs_error(_("%s: %s:%s failed, reason given by server: %s"), progname, hostname, dirname, @@ -747,13 +747,16 @@ nfsmount(const char *spec, const char *node, int flags, } #if NFS_MOUNT_VERSION >= 5 mountres = &mntres.nfsv3.mountres3_u.mountinfo; - i = mountres->auth_flavors.auth_flavors_len; - if (i <= 0) + n_flavors = mountres->auth_flavors.auth_flavors_len; + if (n_flavors <= 0) goto noauth_flavors; flavor = mountres->auth_flavors.auth_flavors_val; - while (--i >= 0) { - /* If no flavour requested, use first simple + for (i = 0; i < n_flavors; ++i) { + /* + * Per RFC2623, section 2.7, we should prefer the + * flavour listed first. + * If no flavour requested, use the first simple * flavour that is offered. */ if (! (data.flags & NFS_MOUNT_SECFLAVOUR) &&