+2001-09-12 NeilBrown <neilb@cse.unsw.edu.au>
+
+ * utils/mountd/auth.c (auth_authenticate_internal): Reverse
+ change from 2000-08-02: It causes problems if someone exports
+ to both a hostname and IP addresses. nfs-utils must be
+ consistant about the canonical name that it chooses.
+
2001-08-17 Ragnar Kjørstad <nfs@ragnark.vestdata.no>
H.J. Lu <hjl@lucon.org>
}
auth_fixpath(path);
- /* First try it w/o doing a hostname lookup... */
- *hpp = get_hostent((const char *)&addr, sizeof(addr), AF_INET);
- exp = export_find(*hpp, path);
-
- if (!exp) {
- /* Ok, that didn't fly. Try it with a reverse lookup. */
- free (*hpp);
- *hpp = gethostbyaddr((const char *)&addr, sizeof(addr),
- AF_INET);
- if (!(*hpp)) {
- *error = no_entry;
- *hpp = get_hostent((const char *)&addr, sizeof(addr), AF_INET);
- return NULL;
- } else {
+ if (!(*hpp = gethostbyaddr((const char *)&addr, sizeof(addr), AF_INET)))
+ *hpp = get_hostent((const char *)&addr, sizeof(addr),
+ AF_INET);
+ else {
/* must make sure the hostent is authorative. */
char **sp;
struct hostent *forward = NULL;
*error = no_forward_dns;
return NULL;
}
- }
+ }
- if (!(exp = export_find(*hpp, path))) {
+ if (!(exp = export_find(*hpp, path))) {
*error = no_entry;
return NULL;
- }
}
-
if (!exp->m_mayexport) {
*error = not_exported;
return NULL;