Subject: pkg/22817: Allow audit-packages to use mirror ftp sites
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jon@apa.bahz.se>
List: netbsd-bugs
Date: 09/16/2003 16:52:37
>Number:         22817
>Category:       pkg
>Synopsis:       Allow audit-packages to use mirror ftp sites
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 16 14:53:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jon Olsson
>Release:        NetBSD 1.6ZB
>Organization:
Monkey Mafia
>Environment:
System: NetBSD apa.bahz.se 1.6ZB NetBSD 1.6ZB (APA) #0: Mon Sep 15 19:30:28 CEST 2003 jon@apa.bahz.se:/usr/obj/sys/arch/i386/compile/APA i386
Architecture: i386
Machine: i386
>Description:
	Under certain circumstances one could want to use a mirror site for the 
	vulnerabilities list. I have this situation at work where I can't contact
	the official NetBSD.org ftp server.
>How-To-Repeat:
	n/a
>Fix:
Apply this patch:
(Maybe the filename vuln-server is bad, change it to your liking)

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/security/audit-packages/Makefile,v
retrieving revision 1.32
diff -u -r1.32 Makefile
--- Makefile	2003/09/16 09:06:03	1.32
+++ Makefile	2003/09/16 14:48:11
@@ -38,6 +38,7 @@
 			-e 's|@MV@|${MV}|g'				\
 			-e 's|@RM@|${RM}|g'				\
 			-e 's|@MKDIR@|${MKDIR}|g'			\
+			-e 's|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g'	\
 			${FILESDIR}/$$f > ${WRKSRC}/$$f;		\
 	done
 	${NROFF} ${WRKSRC}/audit-packages.8 >${WRKSRC}/audit-packages.0
Index: files/download-vulnerability-list
===================================================================
RCS file: /cvsroot/pkgsrc/security/audit-packages/files/download-vulnerability-list,v
retrieving revision 1.19
diff -u -r1.19 download-vulnerability-list
--- files/download-vulnerability-list	2003/09/16 09:06:04	1.19
+++ files/download-vulnerability-list	2003/09/16 14:48:11
@@ -3,13 +3,20 @@
 # $NetBSD: download-vulnerability-list,v 1.19 2003/09/16 09:06:04 agc Exp $
 
 : ${PKGVULNDIR=@PKGVULNDIR@}
+: ${SYSCONFDIR=@PKG_SYSCONFDIR@}
 
 if [ ! -e ${PKGVULNDIR} ]; then
 	echo "Creating ${PKGVULNDIR}"
 	@MKDIR@ ${PKGVULNDIR} || (echo "Can't create ${PKGVULNDIR}" 1>&2; exit 1)
 fi
 
-VUL_SOURCE="ftp://ftp.netbsd.org/pub/NetBSD/packages/distfiles/pkg-vulnerabilities"
+if [ -f ${SYSCONFDIR}/vuln-server ]; then
+    server=`cat ${SYSCONFDIR}/vuln-server`
+else
+    server=ftp.NetBSD.org
+fi
+
+VUL_SOURCE="ftp://$server/pub/NetBSD/packages/distfiles/pkg-vulnerabilities"
 NEW_VUL_LIST=pkg-vulnerabilities.$$
 EXIST_VUL_LIST=pkg-vulnerabilities
 
>Release-Note:
>Audit-Trail:
>Unformatted: