Subject: lpr fix for hiding __ivaliduser{,_sa} from the userland
To: None <tech-userlevel@netbsd.org>
From: None <itojun@iijlab.net>
List: tech-userlevel
Date: 05/26/2000 01:56:32
	the patch is to make __ivaliduser() and __ivaliduser_sa() (in
	lib/libc/net/rcmd.c, which is exported for lpd access control)
	static functions.
	do people think this is reasonable?  Makefile is a bit dirty.
	this is to avoid filename conflict for pathnames.h.

itojun


Index: lib/libc/net/rcmd.c
===================================================================
RCS file: /cvsroot/basesrc/lib/libc/net/rcmd.c,v
retrieving revision 1.41
diff -u -r1.41 rcmd.c
--- rcmd.c	2000/03/05 09:40:57	1.41
+++ rcmd.c	2000/05/25 16:54:03
@@ -43,7 +43,9 @@
 #endif
 #endif /* LIBC_SCCS and not lint */
 
+#ifdef _LIBC
 #include "namespace.h"
+#endif
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
@@ -733,10 +735,14 @@
 
 /*
  * XXX
- * Don't make static, used by lpd(8).
+ * Don't make static, used by lpd(8).  We will be able to change the function
+ * into static function, when we bump libc major #.
  *
  * Returns 0 if ok, -1 if not ok.
  */
+#ifdef notdef	/*_LIBC*/
+static
+#endif
 int
 __ivaliduser(hostf, raddr, luser, ruser)
 	FILE *hostf;
@@ -755,6 +761,9 @@
 	    sizeof(struct sockaddr_in), luser, ruser);
 }
 
+#ifdef notdef	/*_LIBC*/
+static
+#endif
 int
 __ivaliduser_sa(hostf, raddr, salen, luser, ruser)
 	FILE *hostf;
Index: usr.sbin/lpr/lpd/Makefile
===================================================================
RCS file: /cvsroot/basesrc/usr.sbin/lpr/lpd/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- Makefile	1997/10/10 09:26:39	1.11
+++ Makefile	2000/05/25 16:54:03
@@ -3,6 +3,13 @@
 
 PROG=	lpd
 MAN=	lpd.8
-SRCS=	lpd.c printjob.c recvjob.c lpdchar.c key.c modes.c ttcompat.c
+SRCS=	lpd.c printjob.c recvjob.c lpdchar.c key.c modes.c ttcompat.c rcmd.c
+
+# for rcmd.c
+rcmd.o: rcmd.c
+	${CC} -I${.CURDIR}/../../../lib/libc/include -DINET6 \
+		${COMPILE.c:C/${CC}//} ${.IMPSRC}
+
+.PATH:	${.CURDIR}/../../../lib/libc/net
 
 .include <bsd.prog.mk>