diff --git a/include/tests_ports_packages b/include/tests_ports_packages index a6927046..b3dd652b 100644 --- a/include/tests_ports_packages +++ b/include/tests_ports_packages @@ -652,7 +652,7 @@ # Description : Check for vulnerable FreeBSD packages (with pkg) # Notes : Related vulnerability file is /var/db/pkg/vuln.xml # TODO : Run this in any jail - if [ -x /usr/sbin/pkg -a ]; then PREQS_MET="YES"; SKIPREASON=""; else PREQS_MET="NO"; SKIPREASON="pkg tool not available"; fi + if [ -x /usr/sbin/pkg ]; then PREQS_MET="YES"; SKIPREASON=""; else PREQS_MET="NO"; SKIPREASON="pkg tool not available"; fi Register --test-no PKGS-7381 --preqs-met ${PREQS_MET} --skip-reason "${SKIPREASON}" --weight L --network NO --category security --description "Check for vulnerable FreeBSD packages with pkg" if [ ${SKIPTEST} -eq 0 ]; then COUNT=0 @@ -678,8 +678,10 @@ LogText "Result: found an exit code greater than zero, yet no output" fi elif [ $? -eq 65 ]; then + LogText "Result: exited with code 65, meaning there is no vulnerability database" ReportWarning "${TEST_NO}" "No vulnerability database available" "pkg audit" "text:Run pkg audit -f" else + LogText "Result: exited with code $?" ReportException "${TEST_NO}" "Found an unknown exit code for pkg audit. Please create an issue at ${PROJECT_SOURCE}" fi fi