summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorVallish Vaidyeshwara <Vallish.Vaidyeshwara@Sun.COM>2009-03-04 22:54:00 -0800
committerVallish Vaidyeshwara <Vallish.Vaidyeshwara@Sun.COM>2009-03-04 22:54:00 -0800
commitf73f2d5041abc131733c5b495cc546e06827060f (patch)
treee49ba46b1456d0d5f1297920e7f209d51b6b3b0f /usr/src
parent9aa01d984654bcf5acc197ab08e46d4b6d939871 (diff)
downloadillumos-gate-f73f2d5041abc131733c5b495cc546e06827060f.tar.gz
6359212 NFS share sec=none option doesn't work when combined with another sec= option.
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/fs/nfs/nfs_auth.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/nfs/nfs_auth.c b/usr/src/uts/common/fs/nfs/nfs_auth.c
index ac8fbe75cc..93a1014d69 100644
--- a/usr/src/uts/common/fs/nfs/nfs_auth.c
+++ b/usr/src/uts/common/fs/nfs/nfs_auth.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -604,6 +604,33 @@ nfsauth_access(struct exportinfo *exi, struct svc_req *req)
}
access = nfsauth_cache_get(exi, req, flavor);
+
+ /*
+ * Client's security flavor doesn't match with "ro" or
+ * "rw" list. Try again using AUTH_NONE if present.
+ */
+ if ((access & NFSAUTH_WRONGSEC) && (flavor != AUTH_NONE)) {
+ /*
+ * Have we already encountered AUTH_NONE ?
+ */
+ if (authnone_entry != -1) {
+ mapaccess = NFSAUTH_MAPNONE;
+ access = nfsauth_cache_get(exi, req, AUTH_NONE);
+ } else {
+ /*
+ * Check for AUTH_NONE presence.
+ */
+ for (; i < exi->exi_export.ex_seccnt; i++) {
+ if (sp[i].s_secinfo.sc_nfsnum == AUTH_NONE) {
+ mapaccess = NFSAUTH_MAPNONE;
+ access = nfsauth_cache_get(exi, req,
+ AUTH_NONE);
+ break;
+ }
+ }
+ }
+ }
+
if (access & NFSAUTH_DENIED)
access = NFSAUTH_DENIED;