mirror of https://github.com/CISOfy/lynis.git
Simplify checking of file permissions on tests_custom
This commit is contained in:
parent
ee4bd4cb26
commit
c806c59f77
5
lynis
5
lynis
|
@ -889,12 +889,9 @@ ${NORMAL}
|
|||
# Custom tests
|
||||
if [ -f ${INCLUDEDIR}/tests_custom ]; then
|
||||
LogText "Result: tests_custom file found in include directory"
|
||||
LogText "Test: checking file permissions of tests_custom file"
|
||||
FIND=`ls -l ${INCLUDEDIR}/tests_custom | cut -c 2-10`
|
||||
if [ "${FIND}" = "rw-r--r--" -o "${FIND}" = "rw-r-----" -o "${FIND}" = "rw-------" -o "${FIND}" = "r--------" ]; then
|
||||
if SafePerms ${INCLUDEDIR}/tests_custom; then
|
||||
Display --indent 2 --text "- Start custom tests... "
|
||||
LogText "Result: file permissions fine, running custom tests"
|
||||
SafePerms ${INCLUDEDIR}/tests_custom
|
||||
. ${INCLUDEDIR}/tests_custom
|
||||
else
|
||||
LogText "Exception: skipping custom tests, file has bad permissions (should be 640, 600 or 400)"
|
||||
|
|
Loading…
Reference in New Issue