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:
authormboelen <michael@cisofy.com>2015-03-25 19:30:13 +0300
committermboelen <michael@cisofy.com>2015-03-25 19:30:13 +0300
commit30bc903c5a6151ef6c96cf9f4894f4d25ed4d73a (patch)
treec4225b61c8dd870b17b0aeb9552172d47b8e96cb
parentc94269c1d184d12bfb6b50ab4b38f3bf8b43be5e (diff)
Using return codes for file permission checks
-rw-r--r--include/tests_boot_services13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/tests_boot_services b/include/tests_boot_services
index 4eb216d8..35fee381 100644
--- a/include/tests_boot_services
+++ b/include/tests_boot_services
@@ -5,7 +5,7 @@
# Lynis
# ------------------
#
-# Copyright 2007-2015, CISOfy & Michael Boelen, The Netherlands
+# Copyright 2007-2015, Michael Boelen, CISOfy (michael.boelen@cisofy.com)
# Web site: https://cisofy.com
#
# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
@@ -548,7 +548,7 @@
for J in ${FIND}; do
logtext "Test: checking permissions of file ${J}"
IsWorldWritable ${J}
- if [ "${FileIsWorldWritable}" = "TRUE" ]; then
+ if [ $? -eq 1 ]; then
logtext "Result: warning, file ${J} is world writable"
FOUND=1
else
@@ -570,7 +570,7 @@
FIND=`find /etc/rc${NO}.d -type f -print`
for I in ${FIND}; do
IsWorldWritable ${I}
- if [ "${FileIsWorldWritable}" = "TRUE" ]; then
+ if [ $? -eq 1 ]; then
logtext "Result: warning, file ${I} is world writable"
FOUND=1
else
@@ -586,7 +586,7 @@
if [ -f ${I} ]; then
logtext "Test: Checking ${I} file for writable bit"
IsWorldWritable ${I}
- if [ "${FileIsWorldWritable}" = "TRUE" ]; then
+ if [ $? -eq 1 ]; then
ReportWarning ${TEST_NO} "H" "Found writable startup script ${I}"
FOUND=1
logtext "Result: warning, file ${I} is world writable"
@@ -599,8 +599,7 @@
# Check results
if [ ${FOUND} -eq 1 ]; then
Display --indent 2 --text "- Check startup files (permissions)" --result "WARNING" --color RED
- ReportWarning ${TEST_NO} "H" "One or more startup files can be overwritten by all users"
- ReportSuggestion ${TEST_NO} "Check startup scripts for world write access and change permissions if needed"
+ ReportWarning ${TEST_NO} "H" "Found world writable startup scripts"
logtext "Result: found one or more scripts which are possibly writable by other users"
AddHP 0 3
else
@@ -730,4 +729,4 @@ wait_for_keypress
#
#================================================================================
-# Lynis - Copyright 2007-2015, Michael Boelen - www.rootkit.nl - The Netherlands
+# Lynis - Copyright 2007-2015, Michael Boelen, CISOfy - https://cisofy.com