diff options
author | hjl <hjl> | 2000-09-25 22:18:13 +0000 |
---|---|---|
committer | hjl <hjl> | 2000-09-25 22:18:13 +0000 |
commit | 16ff9c8020071d12496daab4acc70ecade033662 (patch) | |
tree | 21f0d32bb30b351ee6220ae91b77f769c86f2c29 /utils/mountd/auth.c | |
parent | c66b083e9a007b02a23c24d22d6afaca555fcbee (diff) | |
download | nfs-utils-16ff9c8020071d12496daab4acc70ecade033662.tar.gz nfs-utils-16ff9c8020071d12496daab4acc70ecade033662.tar.xz nfs-utils-16ff9c8020071d12496daab4acc70ecade033662.zip |
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.
Diffstat (limited to 'utils/mountd/auth.c')
-rw-r--r-- | utils/mountd/auth.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; } } |