X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=utils%2Fmountd%2Fauth.c;h=2ed80bcfaef4aa6e4a37da9ca0034c20ae908317;hb=b25694320f2bdd79de82f2003209b8229eafff36;hp=2bb708ff138dfe23897156cc19597350d0c607af;hpb=ff7c7426065f816ec3c6cd9c46d9ffbfbff80d71;p=nfs-utils.git diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c index 2bb708f..2ed80bc 100644 --- a/utils/mountd/auth.c +++ b/utils/mountd/auth.c @@ -20,6 +20,7 @@ #include "exportfs.h" #include "mountd.h" #include "xmalloc.h" +#include "v4root.h" enum auth_error { @@ -102,6 +103,8 @@ auth_reload() memset(&my_client, 0, sizeof(my_client)); xtab_export_read(); check_useipaddr(); + v4root_set(); + ++counter; return counter; @@ -142,7 +145,7 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller, exp = NULL; for (i = 0; !exp && i < MCL_MAXTYPES; i++) - for (exp = exportlist[i]; exp; exp = exp->m_next) { + for (exp = exportlist[i].p_head; exp; exp = exp->m_next) { if (strcmp(path, exp->m_export.e_path)) continue; if (!use_ipaddr && !client_member(my_client.m_hostname, exp->m_client->m_hostname)) @@ -169,8 +172,7 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller, } } if (!(exp->m_export.e_flags & NFSEXP_INSECURE_PORT) && - (ntohs(caller->sin_port) < IPPORT_RESERVED/2 || - ntohs(caller->sin_port) >= IPPORT_RESERVED)) { + ntohs(caller->sin_port) >= IPPORT_RESERVED) { *error = illegal_port; return NULL; } @@ -223,7 +225,7 @@ auth_authenticate(char *what, struct sockaddr_in *caller, char *path) break; case unknown_host: - xlog(L_WARNING, "%s request from unknown host %s for %s (%s)", + xlog(L_WARNING, "refused %s request from %s for %s (%s): unmatched host", what, inet_ntoa(addr), path, epath); break;