From: hjl Date: Mon, 25 Sep 2000 22:18:13 +0000 (+0000) Subject: 2000-09-26 H.J. Lu X-Git-Tag: nfs-utils-0-2-1-pre1~1 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=16ff9c8020071d12496daab4acc70ecade033662;p=nfs-utils.git 2000-09-26 H.J. Lu * utils/mountd/auth.c (auth_authenticate_internal): Make sure a non-NULL hostent is always returned. --- diff --git a/ChangeLog b/ChangeLog index e9d7f6b..3a67f02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-09-26 H.J. Lu + + * utils/mountd/auth.c (auth_authenticate_internal): Make sure a + non-NULL hostent is always returned. + 2000-09-11 Ion Badulescu * 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; } }