mirror of https://github.com/CISOfy/lynis.git
[AUTH-9268] Improve readability of test
This commit is contained in:
parent
0e18551b2c
commit
0ec7f45f05
|
@ -579,28 +579,29 @@
|
|||
if [ ${SKIPTEST} -eq 0 ]; then
|
||||
FOUND=0
|
||||
LogText "Test: Searching pam modules"
|
||||
for I in ${PAM_FILE_LOCATIONS}; do
|
||||
LogText "Test: Checking ${I}"
|
||||
if [ -d ${I} -a ! -L ${I} ]; then
|
||||
LogText "Result: directory ${I} exists"
|
||||
for DIR in ${PAM_FILE_LOCATIONS}; do
|
||||
LogText "Test: Checking ${DIR}"
|
||||
if [ -d ${DIR} -a ! -L ${DIR} ]; then
|
||||
LogText "Result: directory ${DIR} exists"
|
||||
# Search in the specified directory
|
||||
FIND=`find ${I} -maxdepth 1 -type f -name "pam_*.so" -print | sort`
|
||||
FIND=`find ${DIR} -maxdepth 1 -type f -name "pam_*.so" -print | sort`
|
||||
if [ ! "${FIND}" = "" ]; then FOUND=1; fi
|
||||
for I in ${FIND}; do
|
||||
LogText "Found file: ${I}"
|
||||
Report "pam_module[]=${I}"
|
||||
for FILE in ${FIND}; do
|
||||
LogText "Found file: ${FILE}"
|
||||
Report "pam_module[]=${FILE}"
|
||||
done
|
||||
else
|
||||
LogText "Result: directory ${I} could not be found or is a symlink to another directory"
|
||||
else
|
||||
LogText "Result: directory ${DIR} could not be found or is a symlink to another directory"
|
||||
fi
|
||||
done
|
||||
# Check if we found at least one module
|
||||
if [ ${FOUND} -eq 0 ]; then
|
||||
Display --indent 2 --text "- Checking PAM modules" --result "${STATUS_NOT_FOUND}" --color WHITE
|
||||
LogText "Result: no PAM modules found"
|
||||
else
|
||||
else
|
||||
Display --indent 2 --text "- Checking PAM modules" --result "${STATUS_FOUND}" --color GREEN
|
||||
fi
|
||||
unset DIR; unset FILE; unset FIND
|
||||
fi
|
||||
#
|
||||
#################################################################################
|
||||
|
|
Loading…
Reference in New Issue