aboutsummaryrefslogtreecommitdiffstats
path: root/security/portaudit-db
diff options
context:
space:
mode:
Diffstat (limited to 'security/portaudit-db')
-rw-r--r--security/portaudit-db/Makefile2
-rw-r--r--security/portaudit-db/files/packaudit.sh12
2 files changed, 11 insertions, 3 deletions
diff --git a/security/portaudit-db/Makefile b/security/portaudit-db/Makefile
index 2451ac2d2e2..4d264698f89 100644
--- a/security/portaudit-db/Makefile
+++ b/security/portaudit-db/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= portaudit-db
-PORTVERSION= 0.2
+PORTVERSION= 0.2.1
CATEGORIES= security
DISTFILES=
diff --git a/security/portaudit-db/files/packaudit.sh b/security/portaudit-db/files/packaudit.sh
index 5695124e5f6..6b04da90418 100644
--- a/security/portaudit-db/files/packaudit.sh
+++ b/security/portaudit-db/files/packaudit.sh
@@ -37,6 +37,7 @@ 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
@@ -53,10 +54,17 @@ STYLESHEET="%%DATADIR%%/vuxml2portaudit.xslt"
PUBLIC_HTML="${PUBLIC_HTML:-$HOME/public_html/portaudit}"
HTMLSHEET="%%DATADIR%%/vuxml2html.xslt"
-BASEURL="http://people.freebsd.org/~eik/portaudit/"
+BASEURL="${BASEURL:-http://people.freebsd.org/~eik/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"`
@@ -64,7 +72,7 @@ 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" ]; then
+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"`