From 8777a5e616edeae39c93223055a9eafb113d4256 Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Sat, 15 Oct 2016 16:20:04 +0200 Subject: [PATCH] Use rootdir and proper error redirection --- include/tests_ports_packages | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/tests_ports_packages b/include/tests_ports_packages index b3dd652b..5cc9ed06 100644 --- a/include/tests_ports_packages +++ b/include/tests_ports_packages @@ -652,13 +652,13 @@ # 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 ]; then PREQS_MET="YES"; SKIPREASON=""; else PREQS_MET="NO"; SKIPREASON="pkg tool not available"; fi + if [ -x ${ROOTDIR}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 PACKAGE_AUDIT_TOOL_FOUND=1 PACKAGE_AUDIT_TOOL="pkg audit" - FIND=$(/usr/sbin/pkg audit >& /dev/null) + FIND=$(/usr/sbin/pkg audit 2>&1 /dev/null) if [ $? -eq 0 ]; then LogText "Result: pkg audit results are clean" Display --indent 2 --text "- Checking pkg audit to obtain vulnerable packages" --result "${STATUS_NONE}" --color GREEN