summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/gethostbydns.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-04-29 21:13:50 +0000
committernectar <nectar@FreeBSD.org>2003-04-29 21:13:50 +0000
commite69967f5348cec651f8806d25d2c59ac8ed8c2a2 (patch)
treee9749f1ff2693755bce73e10528fc8cc6a6563ea /lib/libc/net/gethostbydns.c
parent975e4bcef1ba69d85a5c90f1849accc3cd74cb65 (diff)
downloadFreeBSD-src-e69967f5348cec651f8806d25d2c59ac8ed8c2a2.zip
FreeBSD-src-e69967f5348cec651f8806d25d2c59ac8ed8c2a2.tar.gz
`Hide' strlcpy and strlcat (using the namespace.h / __weak_reference
technique) so that we don't wind up calling into an application's version if the application defines them. Inspired by: qpopper's interfering and buggy version of strlcpy
Diffstat (limited to 'lib/libc/net/gethostbydns.c')
-rw-r--r--lib/libc/net/gethostbydns.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index 02cd223..9eeba2f 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -60,6 +60,7 @@ static char fromrcsid[] = "From: Id: gethnamaddr.c,v 8.23 1998/04/07 04:59:46 vi
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "namespace.h"
#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
@@ -78,6 +79,7 @@ __FBSDID("$FreeBSD$");
#include <syslog.h>
#include <stdarg.h>
#include <nsswitch.h>
+#include "un-namespace.h"
#include "res_config.h"
@@ -674,7 +676,7 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap)
uaddr[n] & 0xf,
(uaddr[n] >> 4) & 0xf));
}
- strlcat(qbuf, "ip6.arpa", sizeof(qbuf));
+ _strlcat(qbuf, "ip6.arpa", sizeof(qbuf));
break;
default:
abort();
@@ -686,7 +688,7 @@ _dns_gethostbyaddr(void *rval, void *cb_data, va_list ap)
n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf->buf, sizeof buf->buf);
if (n < 0 && af == AF_INET6) {
*qp = '\0';
- strlcat(qbuf, "ip6.int", sizeof(qbuf));
+ _strlcat(qbuf, "ip6.int", sizeof(qbuf));
n = res_query(qbuf, C_IN, T_PTR, (u_char *)buf->buf,
sizeof buf->buf);
}
OpenPOWER on IntegriCloud