pkg-deinstall

#!/bin/sh
#
# $FreeBSD: ports/ports-mgmt/portaudit/pkg-deinstall,v 1.3 2004/07/01 10:59:47 eik Exp $
#

case $2 in
POST-DEINSTALL)
echo
echo "The portaudit package has been deleted."
if [ -f "%%DATABASEDIR%%/auditfile.tbz" ]; then
echo "If you're *not* upgrading and won't be using"
echo "it any longer, you may want to remove the"
echo "portaudit database:"
echo
echo " rm -Rf %%DATABASEDIR%%"
fi
echo
;;
esac

pkg-descr

portaudit provides a system to check if installed ports are listed in a
database of published security vulnerabilities.

After installation it will update this security database automatically and
include its reports in the output of the daily security run.

If you have found a vulnerability not listed in the database, please contact
the FreeBSD Security Officer . Refer to

http://www.freebsd.org/security/#sec

for more information.

WWW: http://people.freebsd.org/~eik/portaudit/

Oliver Eikemeier

pkg-install

#!/bin/sh
#
# $FreeBSD: ports/ports-mgmt/portaudit/pkg-install,v 1.4 2004/07/01 10:59:47 eik Exp $
#

PREFIX="${PREFIX:-%%PREFIX%%}"

case $2 in
PRE-INSTALL)
if egrep -qs "^(FETCH|MASTER_SITE)_" "$PREFIX/etc/portaudit.conf" ;then
echo
echo "*** WARNING ***"
echo
echo "The preference file format has changed. Please edit"
echo " $PREFIX/etc/portaudit.conf"
echo
fi
if egrep -qs "^daily_status_portaudit_" "/etc/periodic.conf" ;then
echo
echo "*** WARNING ***"
echo
echo "The periodic(8) names have changed. Please edit"
echo " /etc/periodic.conf"
echo
fi
;;
POST-INSTALL)
if [ ! -f "%%DATABASEDIR%%/auditfile.tbz" ]; then
echo
echo "===> To check your installed ports for known vulnerabilities now, do:"
echo
echo " $PREFIX/sbin/portaudit -Fda"
echo
fi
;;
esac

pkg-plist

sbin/portaudit
etc/portaudit.conf.sample
%%PERIODICDIR%%/security/410.portaudit
@dirrmtry %%PERIODICDIR%%/security
@dirrmtry %%PERIODICDIR%%
@exec mkdir -p %%DATABASEDIR%%
@unexec rmdir %%DATABASEDIR%% 2>/dev/null || true

pkg-req

#!/bin/sh
#
# $FreeBSD: ports/ports-mgmt/portaudit/pkg-req,v 1.2 2004/07/13 19:32:09 eik Exp $
#

case $2 in
INSTALL)
if [ -z "${PKG_INFO}" ]; then
if [ -x "%%LOCALBASE%%/sbin/pkg_info" ]; then
PKG_INFO="%%LOCALBASE%%/sbin/pkg_info"
else
PKG_INFO="/usr/sbin/pkg_info"
fi
fi

if [ ! -x "${PKG_INFO}" ]; then
echo "${PKG_INFO} missing, please install port sysutils/pkg_install-devel"
exit 1
fi

PKG_INSTALL_VER=`${PKG_INFO} -qP 2>/dev/null`
if [ -z "${PKG_INSTALL_VER}" -o "${PKG_INSTALL_VER}" -lt %%REQPKGVER%% ]; then
echo "${PKG_INFO} is too old, please update port sysutils/pkg_install-devel"
exit 1
fi

if [ "`echo FreeBSD | tr -s .`" != "FreeBSD" ]; then
echo "tr(1) is broken."
exit 1
fi
;;
esac