mirror of https://github.com/CISOfy/lynis.git
Uniform way of saving warnings and suggestions to the log for later parsing
This commit is contained in:
parent
5dfb031e4d
commit
784224f4e7
|
@ -1264,8 +1264,10 @@
|
|||
# Old style
|
||||
# <ID> <priority/impact> <warning text>
|
||||
if [ "$2" = "L" -o "$2" = "M" -o "$2" = "H" ]; then
|
||||
report "warning[]=$1|$3|"
|
||||
logtext "Warning: $3 [$1]"
|
||||
DETAILS="$2"
|
||||
MESSAGE="$3"
|
||||
TEST="$1"
|
||||
SOLUTION="-"
|
||||
else
|
||||
# New style warning format:
|
||||
# <ID> <Warning> <Details> <Solution>
|
||||
|
@ -1281,9 +1283,10 @@
|
|||
if [ "$2" = "" ]; then MESSAGE="UNKNOWN"; else MESSAGE="$2"; fi
|
||||
if [ "$3" = "" ]; then DETAILS="-"; else DETAILS="$3"; fi
|
||||
if [ "$4" = "" ]; then SOLUTION="-"; else SOLUTION="$4"; fi
|
||||
report "warning[]=${TEST}|${MESSAGE}|${DETAILS}|${SOLUTION}|"
|
||||
logtext "Warning: ${MESSAGE} [test:$1] [details:${DETAILS}] [solution:${SOLUTION}]"
|
||||
fi
|
||||
report "warning[]=${TEST}|${MESSAGE}|${DETAILS}|${SOLUTION}|"
|
||||
logtext "Warning: ${MESSAGE} [test:${TEST}] [details:${DETAILS}] [solution:${SOLUTION}]"
|
||||
|
||||
}
|
||||
|
||||
SafePerms()
|
||||
|
|
Loading…
Reference in New Issue