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>2014-10-14 12:02:41 +0400
committermboelen <michael@cisofy.com>2014-10-14 12:02:41 +0400
commitf5399981c21c32fbb9e2ab54170f26be99308722 (patch)
tree36495c34ec0c964fb9d2de4e6ff6446e03ac7465
parent1f032c767f83a4be6cb2d9c5e4c32214209a2a66 (diff)
When searching for a swap partition in /etd/fstab, use sw as search string, instead of matching sw or swap
-rw-r--r--include/tests_filesystems8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/tests_filesystems b/include/tests_filesystems
index 5b9710eb..397cdc46 100644
--- a/include/tests_filesystems
+++ b/include/tests_filesystems
@@ -223,15 +223,17 @@
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`
- if [ "${FIND}" = "" ]; then
+ #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`
+ 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
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. Swap partition usually have 'sw' or 'swap' in the options field (4th)."
+ 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
#