summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2007-03-15 09:46:33 +1100
committerNeil Brown <neilb@suse.de>2007-03-15 09:46:33 +1100
commitafc841a1f2a62645ec2dfaa333baf07e44a03c08 (patch)
tree6c7e5ecca94b241922e8ea11234d875073ca449e
parentb1e1c8a05afdbbc3f217ef79c31c3b8ca302f9eb (diff)
downloadnfs-utils-afc841a1f2a62645ec2dfaa333baf07e44a03c08.tar.gz
nfs-utils-afc841a1f2a62645ec2dfaa333baf07e44a03c08.tar.xz
nfs-utils-afc841a1f2a62645ec2dfaa333baf07e44a03c08.zip
If -o sec= is not specified for mount, allow either AUTH_SYS or AUTH_NONE.
Solaris servers, when asked to share a filesystem with an anon-uid, will report the only available authentication style as AUTH_NONE in the reply from mountd (even though they actually accept AUTH_SYS and simply ignore the credentiuals). So if no sec= is specified we should really accept anything that can easily be handled. ie. AUTH_SYS or AUTH_NONE.
-rw-r--r--utils/mount/nfsmount.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c
index f21c81c..6226f6c 100644
--- a/utils/mount/nfsmount.c
+++ b/utils/mount/nfsmount.c
@@ -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;
}