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-06-17 18:06:51 +0300
committermboelen <michael@cisofy.com>2015-06-17 18:06:51 +0300
commitb947bb085c0baa34a30aa167efc3002a7248ae3b (patch)
tree3dda68ba190fcdd580bb78e4b02fcc58c5bc0b39
parentf34e59663f2d1f8a46cc3818831e3a0859904d5b (diff)
Changed detection, added examples of fstab entries
-rw-r--r--include/tests_filesystems8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/tests_filesystems b/include/tests_filesystems
index 9b9561a1..9b7536e8 100644
--- a/include/tests_filesystems
+++ b/include/tests_filesystems
@@ -262,21 +262,23 @@
#
# Test : FILE-6336
# Description : Check swap mount options
+ # Examples : [partition] swap swap defaults 0 0
+ # [partition] none swap sw 0 0
if [ -f /etc/fstab ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi
Register --test-no FILE-6336 --preqs-met ${PREQS_MET} --weight L --network NO --description "Checking swap mount options"
if [ ${SKIPTEST} -eq 0 ]; then
# Swap partitions should be mounted with 'sw' or 'swap'
logtext "Test: check swap partitions with incorrect mount options"
#FIND=`awk '{ if ($3=="swap" && ($4!="sw" && $4!="swap" && $4!="defaults")) print $1 }' /etc/fstab`
- FIND=`awk '{ if ($3=="swap" && $4~/sw/) { print $1 }}' /etc/fstab`
+ FIND=`awk '{ if ($3=="swap" && ($4~/sw/ || $4=="defaults") { print $1 }}' /etc/fstab`
if [ ! "${FIND}" = "" ]; then
Display --indent 2 --text "- Testing swap partitions" --result OK --color GREEN
logtext "Result: all swap partitions have correct options (sw or swap)"
else
- Display --indent 2 --text "- Testing swap partitions" --result WARNING --color RED
+ Display --indent 2 --text "- Testing swap partitions" --result "CHECK NEEDED" --color YELLOW
logtext "Result: possible incorrect mount options used for mounting swap partition (${FIND})"
#ReportWarning ${TEST_NO} "L" "Possible incorrect mount options used for swap parition (${FIND})"
- #ReportSuggestion ${TEST_NO} "Check your /etc/fstab file for swap partition mount options"
+ ReportSuggestion ${TEST_NO} "Check your /etc/fstab file for swap partition mount options"
logtext "Notes: usually swap partition have 'sw' or 'swap' in the options field (4th)"
fi
fi