]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
auth_authenticate_newcache: prefer non-V4ROOT export over V4ROOT exports
authorNeilBrown <neilb@suse.de>
Tue, 1 May 2012 19:20:31 +0000 (15:20 -0400)
committerSteve Dickson <steved@redhat.com>
Tue, 1 May 2012 19:29:59 +0000 (15:29 -0400)
Currently auth_authenticate_internal finds an export and if it
is a V4ROOT export, it reports that there is no match.  Unlike
lookup_export() it doesn't keep looking for an acceptable export.

So remove the test from auth_authenticate_internal(), and add it to
auth_authenticate_newcache(), where the search can be allowed to
continue.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mountd/auth.c

index ccc849a7222f9d596764547b7b2c681d88bc914e..384375612a4d3dbb710621e5d02c3289b51cec52 100644 (file)
@@ -159,6 +159,9 @@ auth_authenticate_newcache(const struct sockaddr *caller,
                                continue;
                        if (use_ipaddr && !client_check(exp->m_client, ai))
                                continue;
+                       if (exp->m_export.e_flags & NFSEXP_V4ROOT)
+                               /* not acceptable for v[23] export */
+                               continue;
                        break;
                }
        *error = not_exported;
@@ -187,10 +190,6 @@ auth_authenticate_internal(const struct sockaddr *caller, const char *path,
                        return NULL;
                }
        }
-       if (exp->m_export.e_flags & NFSEXP_V4ROOT) {
-               *error = no_entry;
-               return NULL;
-       }
        if (!(exp->m_export.e_flags & NFSEXP_INSECURE_PORT) &&
                     nfs_get_port(caller) >= IPPORT_RESERVED) {
                *error = illegal_port;