]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd: better hiding of v4root exports from mountd clients
authorJ. Bruce Fields <bfields@citi.umich.edu>
Wed, 13 Jan 2010 00:27:21 +0000 (19:27 -0500)
committerSteve Dickson <steved@redhat.com>
Wed, 13 Jan 2010 20:39:14 +0000 (15:39 -0500)
We've hidden v4root exports from get_exportlist (hence from the
showmount command), but not from other mountd operations--allowing
clients to attempt to mount exports when they should be getting an
immediate error.

Symptoms observed on a linux client were that a mount that previously
would have returned an error immediately now hung.  This restores the
previous behavior.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
utils/mountd/auth.c

index 41a57db8e843e04ff5884f0d54f5f36485eb0cea..13eba70b7bcbab152d2d6a50f4776175c6e48879 100644 (file)
@@ -182,6 +182,10 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
                        return NULL;
                }
        }
+       if (exp->m_export.e_flags & NFSEXP_V4ROOT) {
+               *error = no_entry;
+               return NULL;
+       }
        if (!(exp->m_export.e_flags & NFSEXP_INSECURE_PORT) &&
                     ntohs(caller->sin_port) >= IPPORT_RESERVED) {
                *error = illegal_port;