aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt/portaudit
diff options
context:
space:
mode:
authoreik <eik@FreeBSD.org>2004-06-25 09:21:20 +0800
committereik <eik@FreeBSD.org>2004-06-25 09:21:20 +0800
commit81fa18aba03b5c6c5103bfa4e5fa35e33ce205d6 (patch)
tree427fcef913a989b9400b851e277db04606632bda /ports-mgmt/portaudit
parent1e879f5b0150d8dd84b07f14dd9243172395df02 (diff)
downloadfreebsd-ports-gnome-81fa18aba03b5c6c5103bfa4e5fa35e33ce205d6.tar.gz
freebsd-ports-gnome-81fa18aba03b5c6c5103bfa4e5fa35e33ce205d6.tar.zst
freebsd-ports-gnome-81fa18aba03b5c6c5103bfa4e5fa35e33ce205d6.zip
update to version 0.4.1
Use portaudit [packagename ...] to check if package is listed as vulnerable
Diffstat (limited to 'ports-mgmt/portaudit')
-rw-r--r--ports-mgmt/portaudit/Makefile2
-rw-r--r--ports-mgmt/portaudit/files/portaudit-cmd.sh5
-rw-r--r--ports-mgmt/portaudit/files/portaudit.functions25
3 files changed, 30 insertions, 2 deletions
diff --git a/ports-mgmt/portaudit/Makefile b/ports-mgmt/portaudit/Makefile
index dfd4f458b03c..894f69463c6d 100644
--- a/ports-mgmt/portaudit/Makefile
+++ b/ports-mgmt/portaudit/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= portaudit
-PORTVERSION= 0.4
+PORTVERSION= 0.4.1
CATEGORIES= security
DISTFILES=
diff --git a/ports-mgmt/portaudit/files/portaudit-cmd.sh b/ports-mgmt/portaudit/files/portaudit-cmd.sh
index 54c1f02952ec..99fdcbde8bbd 100644
--- a/ports-mgmt/portaudit/files/portaudit-cmd.sh
+++ b/ports-mgmt/portaudit/files/portaudit-cmd.sh
@@ -151,3 +151,8 @@ if [ -n "$opt_file" ]; then
portaudit_prerequisites
audit_file "$opt_file"
fi
+
+if [ $# -gt 0 ]; then
+ portaudit_prerequisites
+ audit_args "$@"
+fi
diff --git a/ports-mgmt/portaudit/files/portaudit.functions b/ports-mgmt/portaudit/files/portaudit.functions
index f3b6e21db458..af9dfe3d086f 100644
--- a/ports-mgmt/portaudit/files/portaudit.functions
+++ b/ports-mgmt/portaudit/files/portaudit.functions
@@ -186,7 +186,7 @@ audit_file()
close(cmd)
}
END {
- print vul " problem(s) in found."
+ print vul " problem(s) found."
if (vul > 0) {
exit(1)
}
@@ -194,6 +194,29 @@ audit_file()
'
}
+audit_args()
+{
+ VULCNT=0
+ while [ $# -gt 0 ]; do
+ if VLIST=`extract_auditfile | /usr/bin/grep -v '^#' | ${PKG_VERSION} -T "${1}" -`; then
+ VULCNT=$((${VULCNT}+1))
+ echo "${VLIST}" | /usr/bin/awk -F\| '{
+ print "Affected package: '${1}' (matched by " $1 ")"
+ print "Type of problem: " $3 "."
+ split($2, ref, / /)
+ for (r in ref)
+ print "Reference: <" ref[r] ">"
+ print ""
+ }'
+ fi
+ shift
+ done
+ echo "${VULCNT} problem(s) found."
+ if [ ${VULCNT} -gt 0 ]; then
+ return 1
+ fi
+}
+
audit_cwd()
{
if [ ! -r "Makefile" ]; then