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>2016-09-05 20:28:44 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-09-05 20:28:44 +0300
commit0a0453e1bc1683861880f09529ad8a44c12566fc (patch)
treed0582e415184ab678af61ea219c9ffe475fd4c9f /include/tests_filesystems
parente31899a42130d20b2de8a6d7f287c7ff02ca1e07 (diff)
[FILE-6344] Adjusted /proc test
Diffstat (limited to 'include/tests_filesystems')
-rw-r--r--include/tests_filesystems22
1 files changed, 13 insertions, 9 deletions
diff --git a/include/tests_filesystems b/include/tests_filesystems
index cf848c8b..2c23740f 100644
--- a/include/tests_filesystems
+++ b/include/tests_filesystems
@@ -308,17 +308,21 @@
if [ ${SKIPTEST} -eq 0 ]; then
# Proc should be mounted with 'hidepid=2' or 'hidepid=1' at least
LogText "Test: check proc mount with incorrect mount options"
- FIND=$(mount | ${EGREPBINARY} "^/proc" | ${EGREPBINARY} -o "hidepid=[0-9]")
+ FIND=$(mount | ${EGREPBINARY} "/proc " | ${EGREPBINARY} -o "hidepid=[0-9]")
if [ "${FIND}" = "hidepid=2" ]; then
- Display --indent 2 --text "- Testing proc mount" --result "${STATUS_OK}" --color GREEN
+ Display --indent 2 --text "- Testing /proc mount (hidepid)" --result "${STATUS_OK}" --color GREEN
LogText "Result: proc mount mounted with hidepid=2"
- else
- if [ "${FIND}" = "" ]; then
- HIDEPID1_SUGGESTION=" (or at least hidepid=1)"
- fi
- Display --indent 2 --text "- Testing proc mount" --result "${STATUS_SUGGESTION}" --color YELLOW
- LogText "Result: /proc filesystem is not mounted with option hidepid=2"
- #ReportSuggestion ${TEST_NO} "Consider mounting /proc via /etc/fstab with mount option hidepid=2"
+ AddHP 3 3
+ elif [ "${FIND}" = "hidepid=1" ]; then
+ Display --indent 2 --text "- Testing /proc mount (hidepid)" --result "${STATUS_OK}" --color GREEN
+ LogText "Result: proc mount mounted with hidepid=1"
+ AddHP 2 3
+ elif [ -z "${FIND}" ]; then
+ # HIDEPID1_SUGGESTION=" (or at least hidepid=1)"
+ AddHP 0 3
+ Display --indent 2 --text "- Testing /proc mount (hidepid)" --result "${STATUS_SUGGESTION}" --color YELLOW
+ LogText "Result: /proc filesystem is not mounted with option hidepid=1 or hidepid=2"
+ # TODO ReportSuggestion "${TEST_NO}" "Consider mounting /proc via /etc/fstab with mount option hidepid=2" "/proc" "-"
fi
fi
#