mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-24 06:14:33 +02:00
[PKGS-7381] bugfix at detection of pkg tool
This commit is contained in:
parent
d88f755f40
commit
f0b9a64c47
@ -652,7 +652,7 @@
|
|||||||
# Description : Check for vulnerable FreeBSD packages (with pkg)
|
# Description : Check for vulnerable FreeBSD packages (with pkg)
|
||||||
# Notes : Related vulnerability file is /var/db/pkg/vuln.xml
|
# Notes : Related vulnerability file is /var/db/pkg/vuln.xml
|
||||||
# TODO : Run this in any jail
|
# 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"
|
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
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
COUNT=0
|
COUNT=0
|
||||||
@ -678,8 +678,10 @@
|
|||||||
LogText "Result: found an exit code greater than zero, yet no output"
|
LogText "Result: found an exit code greater than zero, yet no output"
|
||||||
fi
|
fi
|
||||||
elif [ $? -eq 65 ]; then
|
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"
|
ReportWarning "${TEST_NO}" "No vulnerability database available" "pkg audit" "text:Run pkg audit -f"
|
||||||
else
|
else
|
||||||
|
LogText "Result: exited with code $?"
|
||||||
ReportException "${TEST_NO}" "Found an unknown exit code for pkg audit. Please create an issue at ${PROJECT_SOURCE}"
|
ReportException "${TEST_NO}" "Found an unknown exit code for pkg audit. Please create an issue at ${PROJECT_SOURCE}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user