From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Jun 11 11:00:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4D771065674 for ; Thu, 11 Jun 2009 11:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A33068FC1F for ; Thu, 11 Jun 2009 11:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BB02qx089056 for ; Thu, 11 Jun 2009 11:00:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n5BB0286089055; Thu, 11 Jun 2009 11:00:02 GMT (envelope-from gnats) Resent-Date: Thu, 11 Jun 2009 11:00:02 GMT Resent-Message-Id: <200906111100.n5BB0286089055@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, John Marshall Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280CD1065672 for ; Thu, 11 Jun 2009 10:51:03 +0000 (UTC) (envelope-from john@rwsrv05.mby.riverwillow.net.au) Received: from nskntmtas06p.mx.bigpond.com (nskntmtas06p.mx.bigpond.com [61.9.168.152]) by mx1.freebsd.org (Postfix) with ESMTP id A35368FC08 for ; Thu, 11 Jun 2009 10:51:02 +0000 (UTC) (envelope-from john@rwsrv05.mby.riverwillow.net.au) Received: from nskntotgx01p.mx.bigpond.com ([58.172.200.238]) by nskntmtas06p.mx.bigpond.com with ESMTP id <20090611105101.WWOJ1960.nskntmtas06p.mx.bigpond.com@nskntotgx01p.mx.bigpond.com> for ; Thu, 11 Jun 2009 10:51:01 +0000 Received: from mail3.riverwillow.net.au ([58.172.200.238]) by nskntotgx01p.mx.bigpond.com with ESMTP id <20090611105100.TVSS2116.nskntotgx01p.mx.bigpond.com@mail3.riverwillow.net.au> for ; Thu, 11 Jun 2009 10:51:00 +0000 Received: from rwsrv05.mby.riverwillow.net.au (localhost [127.0.0.1]) by mail3.riverwillow.net.au (8.14.3/8.14.3) with ESMTP id n5BAp0Ne070197 for ; Thu, 11 Jun 2009 20:51:00 +1000 (AEST) Received: (from john@localhost) by rwsrv05.mby.riverwillow.net.au (8.14.3/8.14.3/Submit) id n5BAoxd5070196; Thu, 11 Jun 2009 20:50:59 +1000 (AEST) Message-Id: <200906111050.n5BAoxd5070196@rwsrv05.mby.riverwillow.net.au> Date: Thu, 11 Jun 2009 20:50:59 +1000 (AEST) From: John Marshall To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/135471: [patch] ports-mgmt/portaudit-db packaudit.conf sourced too late in packaudit.sh X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John Marshall List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2009 11:00:03 -0000 >Number: 135471 >Category: ports >Synopsis: [patch] ports-mgmt/portaudit-db packaudit.conf sourced too late in packaudit.sh >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jun 11 11:00:02 UTC 2009 >Closed-Date: >Last-Modified: >Originator: John Marshall >Release: FreeBSD 7.2-RELEASE i386 >Organization: Riverwillow Pty Ltd >Environment: System: FreeBSD rwsrv05.mby.riverwillow.net.au 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May 1 21:02:03 AEST 2009 root@rwsrv05.mby.riverwillow.net.au:/spare/obj/usr/src/sys/RWSRV05 i386 >Description: It looks like the line in packaudit which sources packaudit.conf landed in the wrong place by accident - and stayed there. This patch: - relocates the sourcing of packaudit.conf to earlier in the file where I think it belongs - doesn't touch the port revision number in the Makefile because I'm not sure what should be done with that in this case. I have left this decision for a potential commiter. packaudit defines all its variables in such a way as to allow for the names to be already defined (e.g. via packaudit.conf or the environment) and supplies its own defaults. Then it sources packaudit.conf. I have deliberately increased the diff context window in the attached patch so that reviewers can easily see what lies between the current and proposed location of the packaudit.conf file sourcing. >How-To-Repeat: Define things in /usr/local/etc/packaudit.conf and watch them get silently ignored - or watch packaudit test default locations and then use untested locations from packaudit.conf. >Fix: --- portaudit-db-patch begins here --- diff -rNU 13 portaudit-db/files/packaudit.sh portaudit-db-mod/files/packaudit.sh --- portaudit-db/files/packaudit.sh 2007-02-19 23:37:15.000000000 +1100 +++ portaudit-db-mod/files/packaudit.sh 2009-06-11 17:48:20.000000000 +1000 @@ -34,54 +34,54 @@ AWK=/usr/bin/awk BASENAME=/usr/bin/basename CAT=/bin/cat DATE=/bin/date ENV=/usr/bin/env MD5=/sbin/md5 MKDIR="/bin/mkdir -p" MKTEMP=/usr/bin/mktemp RM=/bin/rm SED=/usr/bin/sed TAR=/usr/bin/tar XSLTPROC=%%LOCALBASE%%/bin/xsltproc +[ -r "%%PREFIX%%/etc/packaudit.conf" ] && . "%%PREFIX%%/etc/packaudit.conf" + PORTSDIR="${PORTSDIR:-%%PORTSDIR%%}" VUXMLDIR="${VUXMLDIR:-$PORTSDIR/security/vuxml}" PORTAUDITDBDIR="${PORTAUDITDBDIR:-$PORTSDIR/ports-mgmt/portaudit-db}" DATABASEDIR="${DATABASEDIR:-%%DATABASEDIR%%}" STYLESHEET="%%DATADIR%%/vuxml2portaudit.xslt" PUBLIC_HTML="${PUBLIC_HTML:-$HOME/public_html/portaudit}" HTMLSHEET="%%DATADIR%%/vuxml2html.xslt" BASEURL="${BASEURL:-http://www.freebsd.org/ports/portaudit/}" PORTAUDIT2VUXML="%%DATADIR%%/portaudit2vuxml.awk" [ -d "$DATABASEDIR" ] || $MKDIR "$DATABASEDIR" if [ ! -w "$DATABASEDIR" ]; then echo "$DATABASEDIR is not writable by you, exiting." exit 1 fi TMPNAME=`$BASENAME "$0"` VULVER=`$SED -En -e '/^.*\\$FreeBSD\: [^$ ]+,v ([0-9]+(\.[0-9]+)+) [^$]+\\$.*$/{s//\1/p;q;}' "$VUXMLDIR/vuln.xml"` VULURL="http://cvsweb.freebsd.org/ports/security/vuxml/vuln.xml?rev=$VULVER" -[ -r "%%PREFIX%%/etc/packaudit.conf" ] && . "%%PREFIX%%/etc/packaudit.conf" - if [ -d "$PUBLIC_HTML" -a -w "$PUBLIC_HTML" ]; then VULNMD5=`$CAT "$VUXMLDIR/vuln.xml" "$PORTAUDITDBDIR/database/portaudit.xml" "$PORTAUDITDBDIR/database/portaudit.txt" | $MD5` if [ -f "$PUBLIC_HTML/portaudit.md5" ]; then VULNMD5_OLD=`$CAT "$PUBLIC_HTML/portaudit.md5"` fi if [ "$VULNMD5" != "$VULNMD5_OLD" ]; then echo -n "$VULNMD5" > "$PUBLIC_HTML/portaudit.md5" TMPXML=`$MKTEMP -t "$TMPNAME.$$"` || exit 1 $PORTAUDIT2VUXML "$PORTAUDITDBDIR/database/portaudit.txt" "$PORTAUDITDBDIR/database/portaudit.xml" > "$TMPXML" $XSLTPROC $XSLTPROC_EXTRA_ARGS --stringparam vulurl "$VULURL" --stringparam extradoc "$TMPXML" \ -o "$PUBLIC_HTML/" "$HTMLSHEET" "$VUXMLDIR/vuln.xml" $RM "$TMPXML" fi --- portaudit-db-patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: