mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-23 13:54:35 +02:00
[AUTH-9268] Improve readability of test
This commit is contained in:
parent
0e18551b2c
commit
0ec7f45f05
@ -579,28 +579,29 @@
|
|||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
FOUND=0
|
FOUND=0
|
||||||
LogText "Test: Searching pam modules"
|
LogText "Test: Searching pam modules"
|
||||||
for I in ${PAM_FILE_LOCATIONS}; do
|
for DIR in ${PAM_FILE_LOCATIONS}; do
|
||||||
LogText "Test: Checking ${I}"
|
LogText "Test: Checking ${DIR}"
|
||||||
if [ -d ${I} -a ! -L ${I} ]; then
|
if [ -d ${DIR} -a ! -L ${DIR} ]; then
|
||||||
LogText "Result: directory ${I} exists"
|
LogText "Result: directory ${DIR} exists"
|
||||||
# Search in the specified directory
|
# 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
|
if [ ! "${FIND}" = "" ]; then FOUND=1; fi
|
||||||
for I in ${FIND}; do
|
for FILE in ${FIND}; do
|
||||||
LogText "Found file: ${I}"
|
LogText "Found file: ${FILE}"
|
||||||
Report "pam_module[]=${I}"
|
Report "pam_module[]=${FILE}"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
LogText "Result: directory ${I} could not be found or is a symlink to another directory"
|
LogText "Result: directory ${DIR} could not be found or is a symlink to another directory"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
# Check if we found at least one module
|
# Check if we found at least one module
|
||||||
if [ ${FOUND} -eq 0 ]; then
|
if [ ${FOUND} -eq 0 ]; then
|
||||||
Display --indent 2 --text "- Checking PAM modules" --result "${STATUS_NOT_FOUND}" --color WHITE
|
Display --indent 2 --text "- Checking PAM modules" --result "${STATUS_NOT_FOUND}" --color WHITE
|
||||||
LogText "Result: no PAM modules found"
|
LogText "Result: no PAM modules found"
|
||||||
else
|
else
|
||||||
Display --indent 2 --text "- Checking PAM modules" --result "${STATUS_FOUND}" --color GREEN
|
Display --indent 2 --text "- Checking PAM modules" --result "${STATUS_FOUND}" --color GREEN
|
||||||
fi
|
fi
|
||||||
|
unset DIR; unset FILE; unset FIND
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user