-# $OpenBSD: Makefile,v 1.4 1997/03/12 11:30:34 downsj Exp $
+# $OpenBSD: Makefile,v 1.5 1997/03/14 03:40:30 downsj Exp $
# $NetBSD: Makefile,v 1.7 1996/02/02 15:25:33 mrg Exp $
# from $Id: Makefile,v 8.1 1994/12/15 06:23:43 vixie Exp
-SUBDIR= libresolv named named-xfer ndc reload restart dig nslookup \
+SUBDIR= named named-xfer ndc reload restart dig nslookup \
host dnsquery addr
VER= 4.9.5-P1
-# $OpenBSD: Makefile.inc,v 1.4 1997/03/13 08:57:57 downsj Exp $
+# $OpenBSD: Makefile.inc,v 1.5 1997/03/14 03:40:31 downsj Exp $
# $NetBSD: Makefile.inc,v 1.1 1996/02/02 15:25:35 mrg Exp $
# from: $Id: Makefile.inc,v 8.3 1995/12/31 23:28:00 vixie Exp
IOT= ABRT
CONFIG?= -DUSE_OPTIONS_H
-INCLUDE?= -I${.CURDIR} -I${BIND_DIR} -I${BIND_DIR}/include
+INCLUDE?= -I${.CURDIR} -I${BIND_DIR}
-# we need to use our version of libresolv.
-.if exists(${BIND_DIR}/libresolv/${__objdir})
-LIBRESOLV= ${BIND_DIR}/libresolv/${__objdir}/libresolv.a
-.else
-LIBRESOLV= ${BIND_DIR}/libresolv/libresolv.a
-.endif
+# It's in libc now.
+LIBRESOLV=
-# $OpenBSD: Makefile,v 1.3 1997/03/12 10:41:48 downsj Exp $
+# $OpenBSD: Makefile,v 1.4 1997/03/14 03:40:32 downsj Exp $
# $NetBSD: Makefile,v 1.2 1996/03/31 13:55:34 mrg Exp $
# from: $Id: Makefile,v 8.1 1994/12/15 06:23:45 vixie Exp
.PATH: ${.CURDIR}/../nslookup \
- ${.CURDIR}/../libresolv \
+ ${.CURDIR}/../../../lib/libc/net \
${.CURDIR}/../man
PROG= dig
-SRCS= dig.c list.c subr.c debug.c send.c base64.c gethnamaddr.c res_comp.c \
+SRCS= dig.c list.c subr.c debug.c send.c base64.c gethostnamadr.c res_comp.c \
res_debug.c res_init.c res_mkquery.c res_query.c res_send.c \
inet_ntop.c inet_pton.c
CFLAGS+=${INCLUDE} ${CONFIG} -DDEBUG
-/* $OpenBSD: res_init.c,v 1.1 1997/03/12 10:42:09 downsj Exp $ */
+/* $OpenBSD: res_init.c,v 1.2 1997/03/14 03:40:33 downsj Exp $ */
/*
* ++Copyright++ 1985, 1989, 1993
static char sccsid[] = "@(#)res_init.c 8.1 (Berkeley) 6/7/93";
static char rcsid[] = "$From: res_init.c,v 8.7 1996/09/28 06:51:07 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: res_init.c,v 1.1 1997/03/12 10:42:09 downsj Exp $";
+static char rcsid[] = "$OpenBSD: res_init.c,v 1.2 1997/03/14 03:40:33 downsj Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
_res.pfcode = 0;
/* Allow user to override the local domain definition */
- if ((cp = getenv("LOCALDOMAIN")) != NULL) {
+ if (issetugid() == 0 && (cp = getenv("LOCALDOMAIN")) != NULL) {
(void)strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
+ _res.defdname[sizeof(_res.defdname) - 1] = '\0';
haveenv++;
/*
if ((*cp == '\0') || (*cp == '\n'))
continue;
strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
+ _res.defdname[sizeof(_res.defdname) - 1] = '\0';
if ((cp = strpbrk(_res.defdname, " \t\n")) != NULL)
*cp = '\0';
havesearch = 0;
if ((*cp == '\0') || (*cp == '\n'))
continue;
strncpy(_res.defdname, cp, sizeof(_res.defdname) - 1);
+ _res.defdname[sizeof(_res.defdname) - 1] = '\0';
if ((cp = strchr(_res.defdname, '\n')) != NULL)
*cp = '\0';
/*
#endif /* !RFC1535 */
}
- if ((cp = getenv("RES_OPTIONS")) != NULL)
+ if (issetugid())
+ _res.options |= RES_NOALIASES;
+ else if ((cp = getenv("RES_OPTIONS")) != NULL)
res_setoptions(cp, "env");
_res.options |= RES_INIT;
return (0);
}
+/* ARGSUSED */
static void
res_setoptions(options, source)
char *options, *source;
-/* $OpenBSD: res_mkquery.c,v 1.1 1997/03/12 10:42:10 downsj Exp $ */
+/* $OpenBSD: res_mkquery.c,v 1.2 1997/03/14 03:40:33 downsj Exp $ */
/*
* ++Copyright++ 1985, 1993
static char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$From: res_mkquery.c,v 8.5 1996/08/27 08:33:28 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.1 1997/03/12 10:42:10 downsj Exp $";
+static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.2 1997/03/14 03:40:33 downsj Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
* Form all types of queries.
* Returns the size of the result or -1.
*/
+/* ARGSUSED */
int
res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen)
int op; /* opcode of query */
-/* $OpenBSD: res_query.c,v 1.1 1997/03/12 10:42:10 downsj Exp $ */
+/* $OpenBSD: res_query.c,v 1.2 1997/03/14 03:40:34 downsj Exp $ */
/*
* ++Copyright++ 1988, 1993
static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: res_query.c,v 1.1 1997/03/12 10:42:10 downsj Exp $";
+static char rcsid[] = "$OpenBSD: res_query.c,v 1.2 1997/03/14 03:40:34 downsj Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
break;
for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2)
;
- abuf[sizeof(abuf) - 1] = *cp2 = '\0';
strncpy(abuf, cp1, sizeof(abuf) - 1);
+ abuf[sizeof(abuf) - 1] = *cp2 = '\0';
fclose(fp);
return (abuf);
}