Mark deprecated options as a warning

This commit is contained in:
Michael Boelen 2018-01-23 14:29:37 +01:00
parent bae33db57b
commit 3ba399c4c3
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04

View File

@ -25,6 +25,7 @@
# Set default values (should be equal to default.prf)
SETTING_LOG_TESTS_INCORRECT_OS=1
SETTING_SHOW_REPORT_SOLUTION=0
DEPRECATED_OPTION=""
#
#################################################################################
#
@ -37,6 +38,7 @@
# Old style configuration
OPTION=$(echo ${CONFIGOPTION} | cut -d ':' -f2)
VALUE=$(echo ${CONFIGOPTION} | cut -d ':' -f3 | sed 's/!space!/ /g')
DEPRECATED_OPTION="${OPTION}"
else
OPTION=$(echo ${CONFIGOPTION} | cut -d '=' -f1)
VALUE=$(echo ${CONFIGOPTION} | cut -d '=' -f2 | sed 's/!space!/ /g')
@ -167,10 +169,11 @@
OPTION_FREEBSD_SKIP_PORTAUDIT="${VALUE}"
;;
# Lynis Enterprise: group name
# Lynis Enterprise: group name - deprecrated option
group)
GROUP_NAME="${VALUE}"
AddSetting "group" "${GROUP_NAME}" "Group"
DEPRECATED_OPTION="group"
;;
hostalias | host-alias)
@ -488,7 +491,7 @@
#
#################################################################################
#
# Add group name to report
# Add group name to report - deprecated
if [ ! -z "${GROUP_NAME}" ]; then Report "group=${GROUP_NAME}"; fi
#
#################################################################################
@ -516,6 +519,13 @@
#
#################################################################################
#
if [ ! -z "${DEPRECATED_OPTION}" ]; then
ReportWarning "LYNIS" "One or more deprecated options used" "${DEPRECATED_OPTION}" "Update your profile"
fi
#
#################################################################################
#
Display --indent 2 --text "- Checking profiles..." --result "DONE" --color GREEN
LogTextBreak