Subject: lib/4347: libwrap/hosts_access.c fatal compiler warning with -DNETGROUP
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jbernard@tater.mines.edu>
List: netbsd-bugs
Date: 10/25/1997 12:19:21
>Number:         4347
>Category:       lib
>Synopsis:       libwrap/hosts_access.c fatal compiler warning with -DNETGROUP
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 25 11:50:02 1997
>Last-Modified:
>Originator:     Jim Bernard
>Organization:
	Speaking for myself
>Release:        October 25, 1997
>Environment:
System: NetBSD zoo 1.3_ALPHA NetBSD 1.3_ALPHA (ZOO) #0: Sat Oct 25 08:10:12 MDT 1997 local@zoo:/home/local/compile/sys/arch/i386/compile/ZOO i386


>Description:
	The recent activation of WARNS in the lib Makefile breaks compilation
	of libwrap/hosts_access.c if -DNETGROUP is defined--the problem is
	missing prototypes for yp_get_default_domain and innetgr:

===> libwrap
cc -O -DFACILITY=LOG_AUTHPRIV -DSEVERITY=LOG_INFO -DNETGROUP -DAPPEND_DOT -DREAL_DAEMON_DIR=\"/usr/libexec\" -DHOSTS_ACCESS -DDAEMON_UMASK=022 -DRFC931_TIMEOUT=10 -DALWAYS_HOSTNAME -DSYS_ERRLIST_DEFINED -DHOSTS_ALLOW=\"/etc/hosts.allow\" -DHOSTS_DENY=\"/etc/hosts.deny\" -DPROCESS_OPTIONS  -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith  -c hosts_access.c
cc1: warnings being treated as errors
hosts_access.c: In function `host_match':
hosts_access.c:270: warning: implicit declaration of function `yp_get_default_domain'
hosts_access.c:271: warning: implicit declaration of function `innetgr'
*** Error code 1

Stop.

>How-To-Repeat:
	Add -DNETGROUP to CFLAGS in lib/libwrap/Makefile.cflags and make.

>Fix:
	(Aside: Perhaps we should permanently add -DNETGROUP to CFLAGS.)

--- hosts_access.c-dist	Thu Oct  9 17:16:37 1997
+++ hosts_access.c	Sat Oct 25 12:04:49 1997
@@ -38,10 +38,14 @@
 #include <syslog.h>
 #include <ctype.h>
 #include <errno.h>
 #include <setjmp.h>
 #include <string.h>
+#ifdef  NETGROUP
+#include <netgroup.h>
+#include <rpcsvc/ypclnt.h>
+#endif
 
 extern int errno;
 
 #ifndef	INADDR_NONE
 #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
>Audit-Trail:
>Unformatted: