Using return codes and minor cleanups of code

This commit is contained in:
mboelen 2015-03-25 17:31:17 +01:00
parent 30bc903c5a
commit 9978e5c824

View File

@ -5,8 +5,8 @@
# Lynis # Lynis
# ------------------ # ------------------
# #
# Copyright 2007-2015, Michael Boelen (michael@rootkit.nl), The Netherlands # Copyright 2007-2015, Michael Boelen, CISOfy (michael.boelen@cisofy.com)
# Web site: http://www.rootkit.nl # Web site: https://cisofy.com
# #
# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are # Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
# welcome to redistribute it under the terms of the GNU General Public License. # welcome to redistribute it under the terms of the GNU General Public License.
@ -69,7 +69,7 @@
Display --indent 2 --text "- /etc/motd" --result FOUND --color GREEN Display --indent 2 --text "- /etc/motd" --result FOUND --color GREEN
if [ ! -L /etc/motd ]; then if [ ! -L /etc/motd ]; then
IsWorldWritable /etc/motd IsWorldWritable /etc/motd
if [ "${FileIsWorldWritable}" = "TRUE" ]; then if [ $? -eq 1 ]; then
Display --indent 4 --text "- /etc/motd permissions" --result WARNING --color RED Display --indent 4 --text "- /etc/motd permissions" --result WARNING --color RED
logtext "Result: /etc/motd is world writable. Users can change this file!" logtext "Result: /etc/motd is world writable. Users can change this file!"
ReportWarning ${TEST_NO} "H" "/etc/motd is world writable" ReportWarning ${TEST_NO} "H" "/etc/motd is world writable"
@ -246,4 +246,4 @@ wait_for_keypress
# HPUX: /etc/copyright # HPUX: /etc/copyright
# #
#================================================================================ #================================================================================
# Lynis - Copyright 2007-2015, Michael Boelen - www.rootkit.nl - The Netherlands # Lynis - Copyright 2007-2015, Michael Boelen, CISOfy - https://cisofy.com