summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--utils/mountd/auth.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e9d7f6b..3a67f02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-09-26 H.J. Lu <hjl@lucon.org>
+
+ * utils/mountd/auth.c (auth_authenticate_internal): Make sure a
+ non-NULL hostent is always returned.
+
2000-09-11 Ion Badulescu <ionut@moisil.dev.hydraweb.com>
* etc/redhat/nfslock.init: don't kill lockd processes that do not
diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c
index 49567c9..2b4051e 100644
--- a/utils/mountd/auth.c
+++ b/utils/mountd/auth.c
@@ -89,6 +89,7 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
AF_INET);
if (!(*hpp)) {
*error = no_entry;
+ *hpp = get_hostent((const char *)&addr, sizeof(addr), AF_INET);
return NULL;
} else {
/* must make sure the hostent is authorative. */
@@ -96,6 +97,7 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
struct hostent *forward = NULL;
char *tmpname;
+ *hpp = hostent_dup (*hpp);
tmpname = xstrdup((*hpp)->h_name);
if (tmpname) {
forward = gethostbyname(tmpname);
@@ -111,15 +113,14 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller,
if (!*sp) {
/* it was a FAKE */
*error = faked_hostent;
- *hpp = hostent_dup (*hpp);
return NULL;
}
+ free (*hpp);
*hpp = hostent_dup (forward);
}
else {
/* never heard of it. misconfigured DNS? */
*error = no_forward_dns;
- *hpp = hostent_dup (*hpp);
return NULL;
}
}