diff options
author | StrangeBubble <yann.ilas@gmail.com> | 2016-05-02 14:23:43 +0300 |
---|---|---|
committer | Michael Boelen <michael@cisofy.com> | 2016-05-02 14:23:43 +0300 |
commit | 81a4821636b56a353ebe8cd51c5c36963a28b123 (patch) | |
tree | 420e5066f752d271921aec00bb4d0a1c1794b4be /include/tests_boot_services | |
parent | 4913caadbc79acf30efda11ffa0211fc7dc9ef31 (diff) |
Check if file is symlink or not (#184)
Diffstat (limited to 'include/tests_boot_services')
-rw-r--r-- | include/tests_boot_services | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/tests_boot_services b/include/tests_boot_services index 6c9fcb13..b9c66f30 100644 --- a/include/tests_boot_services +++ b/include/tests_boot_services @@ -647,13 +647,20 @@ CHECKFILES="/etc/rc /etc/rc.local /etc/rc.d/rc.sysinit" for I in ${CHECKFILES}; do if [ -f ${I} ]; then - LogText "Test: Checking ${I} file for writable bit" - if IsWorldWritable ${I}; then - ReportWarning ${TEST_NO} "H" "Found writable startup script ${I}" + ShowSymlinkPath "${I}" + if [ ${FOUNDPATH} -eq 1 ]; then + CHECKFILE="$SYMLINK" + LogText "Result: found the path behind this symlink (${CHECKFILE} --> ${I})" + else + CHECKFILE="$I" + fi + LogText "Test: Checking ${CHECKFILE} file for writable bit" + if IsWorldWritable ${CHECKFILE}; then + ReportWarning ${TEST_NO} "H" "Found writable startup script ${CHECKFILE}" FOUND=1 - LogText "Result: warning, file ${I} is world writable" + LogText "Result: warning, file ${CHECKFILE} is world writable" else - LogText "Result: good, file ${I} not world writable" + LogText "Result: good, file ${CHECKFILE} not world writable" fi fi done |