Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2018-12-17 11:58:57 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2018-12-17 11:58:57 +0300
commite014e123103f9f1b9ba2daf9a543712b541b2f5d (patch)
tree7fac720d0cb389bc0ca6b820d65e8373a40a7e47
parent47e37bf058d3125c6dc4938ad649a21092389209 (diff)
Remove FIND1 variable, as we prefer FIND to limit number of variables
-rw-r--r--include/tests_authentication18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/tests_authentication b/include/tests_authentication
index cf1409a5..6519b9cd 100644
--- a/include/tests_authentication
+++ b/include/tests_authentication
@@ -711,24 +711,24 @@
case ${LINUX_VERSION} in
"SuSE")
PREQS_MET="YES"
- FIND1=$(passwd -a -S 2> /dev/null | ${AWKBINARY} '{ if ($2=="P" && $5=="99999") print $1 }')
+ FIND=$(passwd -a -S 2> /dev/null | ${AWKBINARY} '{ if ($2=="P" && $5=="99999") print $1 }')
FIND2=$(passwd -a -S 2> /dev/null | ${AWKBINARY} '{ if ($2=="NP") print $1 }')
;;
*)
PREQS_MET="YES"
- FIND1=$(passwd --all --status 2> /dev/null | ${AWKBINARY} '{ if ($2=="P" && $5=="99999") print $1 }')
+ FIND=$(passwd --all --status 2> /dev/null | ${AWKBINARY} '{ if ($2=="P" && $5=="99999") print $1 }')
FIND2=$(passwd --all --status 2> /dev/null | ${AWKBINARY} '{ if ($2=="NP") print $1 }')
;;
esac
- elif [ ${OS_REDHAT_OR_CLONE} -eq 1 ]; then
+ elif [ ${OS_REDHAT_OR_CLONE} -eq 1 ]; then
PREQS_MET="YES"
- FIND1=$(for I in $(${AWKBINARY} -F: '{print $1}' ${ROOTDIR}etc/passwd) ; do passwd -S $I | ${AWKBINARY} '{ if ($2=="PS" && $5=="99999") print $1 }' ; done)
+ FIND=$(for I in $(${AWKBINARY} -F: '{print $1}' ${ROOTDIR}etc/passwd) ; do passwd -S $I | ${AWKBINARY} '{ if ($2=="PS" && $5=="99999") print $1 }' ; done)
FIND2=$(for I in $(${AWKBINARY} -F: '{print $1}' ${ROOTDIR}etc/passwd) ; do passwd -S $I | ${AWKBINARY} '{ if ($2=="NP") print $1 }' ; done)
- else
+ else
LogText "Result: skipping test for this Linux version"
ReportManual "AUTH-9282:01"
PREQS_MET="NO"
- FIND1=""
+ FIND=""
FIND2=""
fi
else
@@ -740,12 +740,12 @@
Register --test-no AUTH-9282 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Checking password protected account without expire date"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Checking Linux version and password expire date status"
- if [ -z "${FIND1}" ]; then
+ if [ -z "${FIND}" ]; then
LogText "Result: all accounts seem to have an expire date"
Display --indent 2 --text "- Accounts without expire date" --result "${STATUS_OK}" --color GREEN
else
LogText "Result: found one or more accounts with expire date set"
- for I in ${FIND1}; do
+ for I in ${FIND}; do
LogText "Account without expire date: ${I}"
done
Display --indent 2 --text "- Accounts without expire date" --result "${STATUS_SUGGESTION}" --color YELLOW
@@ -760,7 +760,7 @@
Register --test-no AUTH-9283 --preqs-met ${PREQS_MET} --weight L --network NO --category security --description "Checking accounts without password"
if [ ${SKIPTEST} -eq 0 ]; then
LogText "Test: Checking passwordless accounts"
- if [ "${FIND2}" = "" ]; then
+ if [ -z "${FIND2}" ]; then
LogText "Result: all accounts seem to have a password"
Display --indent 2 --text "- Accounts without password" --result "${STATUS_OK}" --color GREEN
else