]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
2000-09-26 H.J. Lu <hjl@lucon.org>
authorhjl <hjl>
Mon, 25 Sep 2000 22:18:13 +0000 (22:18 +0000)
committerhjl <hjl>
Mon, 25 Sep 2000 22:18:13 +0000 (22:18 +0000)
* utils/mountd/auth.c (auth_authenticate_internal): Make sure a
non-NULL hostent is always returned.

ChangeLog
utils/mountd/auth.c

index e9d7f6b638ea52ba103ca8a26b3d1d216ba968ba..3a67f0204dca5af2e44563659ce47402f07fe695 100644 (file)
--- 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
index 49567c93158b384a592ebed479a689c733dea593..2b4051e1676a25f776ab1a19d28f14e4ff7c267e 100644 (file)
@@ -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;
                }
            }