Subject: bin/2275: Dig depends on resolver library being built with -DEBUG, but it isn't
To: None <gnats-bugs@NetBSD.ORG>
From: None <kenh@cmf.nrl.navy.mil>
List: netbsd-bugs
Date: 03/31/1996 01:17:40
>Number:         2275
>Category:       bin
>Synopsis:       Dig needs a resolver library built with -DEBUG - ours isn't
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 31 01:35:01 1996
>Last-Modified:
>Originator:     Ken Hornstein
>Organization:
None
	
>Release:        NetBSD-current, 3/29/96 <NetBSD-current source date>
>Environment:
	
System: NetBSD excalibur 1.1B NetBSD 1.1B (EXCALIBUR) #14: Wed Mar 27 00:15:10 EST 1996 kenh@excalibur:/usr/src/sys/arch/i386/compile/EXCALIBUR i386


>Description:
The "dig" utility (/usr/sbin/dig) prints out it's queries using the RES_DEBUG
feature of the resolver library.  RES_DEBUG only functions if DEBUG is defined
while building the resolver library.  However, the NetBSD resolver portion of
the shared C library is not built using DEBUG.  Thus, "dig" never prints out
the queries it receives.
	
>How-To-Repeat:
See dig run.  See dig print out nothing.  Run dig, run!
	
>Fix:
	
I'm not sure what the "right" thing to do is.  As I see it, there are two
options:

- Build the resolver library with -DDEBUG.  This will let every program set
  the RES_DEBUG flag and actually have it be useful.  It would also increase
  the size of the shared C library.

- Build "dig" with it's own copies of the necessary resolver functions with
  -DDEBUG defined.

Here's a patch that implements the second option:

--- Makefile.orig	Sun Mar 31 01:05:03 1996
+++ Makefile	Sun Mar 31 01:08:55 1996
@@ -2,11 +2,13 @@
 # from: $Id: Makefile,v 8.1 1994/12/15 06:23:45 vixie Exp 
 
 .PATH:	${.CURDIR}/../nslookup \
-	${.CURDIR}/../man
+	${.CURDIR}/../man \
+	${.CURDIR}/../../../lib/libc/net
 
 PROG=	dig
-SRCS=	dig.c list.c subr.c debug.c send.c
-CFLAGS+=	-I${.CURDIR}/..
+SRCS=	dig.c list.c subr.c debug.c send.c gethostnamadr.c res_init.c \
+	res_mkquery.c res_query.c res_send.c
+CFLAGS+=	-I${.CURDIR}/.. -DDEBUG
 
 .include <bsd.prog.mk>
 .include "../../Makefile.inc"
>Audit-Trail:
>Unformatted: