X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnfsmount.c;h=0188caa2a7b8612d6fe5a2a175d7af922ddfd22d;hp=f21c81c4a583c077facab4c4b105b0ed84f00c65;hb=993ec3f888a28c60d49ae0f8f1aa725b6b618a81;hpb=e6e19816da66cde1cc4fd062c898ce66a9b4e336 diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c index f21c81c..0188caa 100644 --- a/utils/mount/nfsmount.c +++ b/utils/mount/nfsmount.c @@ -818,7 +818,7 @@ nfsmnt_check_compat(const struct pmap *nfs_pmap, const struct pmap *mnt_pmap) int nfsmount(const char *spec, const char *node, int *flags, char **extra_opts, char **mount_opts, int *nfs_mount_vers, - int running_bg) + int running_bg, int *need_statd) { static char *prev_bg_host; char hostdir[1024]; @@ -902,7 +902,6 @@ nfsmount(const char *spec, const char *node, int *flags, #if NFS_MOUNT_VERSION >= 2 data.namlen = NAME_MAX; #endif - data.pseudoflavor = AUTH_SYS; bg = 0; retry = 10000; /* 10000 minutes ~ 1 week */ @@ -1090,6 +1089,15 @@ nfsmount(const char *spec, const char *node, int *flags, flavor = mountres->auth_flavors.auth_flavors_val; while (--i >= 0) { + /* If no flavour requested, use first simple + * flavour that is offered. + */ + if (! (data.flags & NFS_MOUNT_SECFLAVOUR) && + (flavor[i] == AUTH_SYS || + flavor[i] == AUTH_NONE)) { + data.pseudoflavor = flavor[i]; + data.flags |= NFS_MOUNT_SECFLAVOUR; + } if (flavor[i] == data.pseudoflavor) yum = 1; #ifdef NFS_MOUNT_DEBUG @@ -1102,7 +1110,7 @@ nfsmount(const char *spec, const char *node, int *flags, "mount: %s:%s failed, " "security flavor not supported\n", hostname, dirname); - /* server has registered us in mtab, send umount */ + /* server has registered us in rmtab, send umount */ nfs_call_umount(&mnt_server, &dirname); goto fail; } @@ -1177,6 +1185,7 @@ noauth_flavors: strcat(new_opts, cbuf); *extra_opts = xstrdup(new_opts); + *need_statd = ! (data.flags & NFS_MOUNT_NONLM); return 0; /* abort */