mirror of https://github.com/CISOfy/lynis.git
Properly parse PAM lines and add them to report [AUTH-9264]
This commit is contained in:
parent
b81d3cc3e0
commit
3609da194a
|
@ -636,13 +636,13 @@
|
||||||
logtext "Result: file /etc/pam.conf exists"
|
logtext "Result: file /etc/pam.conf exists"
|
||||||
Display --indent 2 --text "- Checking PAM configuration files (pam.conf)" --result FOUND --color GREEN
|
Display --indent 2 --text "- Checking PAM configuration files (pam.conf)" --result FOUND --color GREEN
|
||||||
logtext "Test: searching PAM configuration files"
|
logtext "Test: searching PAM configuration files"
|
||||||
FIND=`cat /etc/pam.conf | grep -v "^#" | grep -v "^$" | sed 's/ /!space!/g'`
|
FIND=`cat /etc/pam.conf | grep -v "^#" | grep -v "^$" | sed 's/[[:space:]]/ /g' | sed 's/ / /g' | sed 's/ /:space:/g'`
|
||||||
if [ "${FIND}" = "" ]; then
|
if [ "${FIND}" = "" ]; then
|
||||||
logtext "Result: File has no configuration options defined (empty, or only filled with comments and empty lines)"
|
logtext "Result: File has no configuration options defined (empty, or only filled with comments and empty lines)"
|
||||||
else
|
else
|
||||||
logtext "Result: found one or more configuration lines"
|
logtext "Result: found one or more configuration lines"
|
||||||
for I in ${FIND}; do
|
for I in ${FIND}; do
|
||||||
I=`echo ${I} | sed 's/!space!/ /g'`
|
I=`echo ${I} | sed 's/:space:/ /g'`
|
||||||
logtext "Found line: ${I}"
|
logtext "Found line: ${I}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue