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-09-04 22:38:57 +0400
committermboelen <michael@cisofy.com>2014-09-04 22:38:57 +0400
commit7af9a9e88c6d625ece35c8c175a5848e8d720c4c (patch)
tree94575c9e8581a570c20a517579b89d5c010947fe
parentb121be4317d87432e7b2dbc64eeaeadae3231f14 (diff)
Fixed typo when searching for swap partition
-rw-r--r--include/tests_filesystems15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/tests_filesystems b/include/tests_filesystems
index 77a5e847..629ee97e 100644
--- a/include/tests_filesystems
+++ b/include/tests_filesystems
@@ -191,7 +191,18 @@
for I in ${FIND}; do
FOUND=1
logtext "Swap partition found: ${I}"
- # YYY add test if partition is not a normal partition (e.g. UUID=)
+ # YYY Add a test if partition is not a normal partition (e.g. UUID=)
+ # Can be ^/dev/mapper/vg-name_lv-name
+ # Can be ^/dev/partition
+ # Can be ^UUID=uuid --> /dev/disk/by-uuid/<uuid>
+ # if [ ! "${BLKIDBINARY}" = "" ]; then
+ # FIND2=`${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//'`
+ # else
+ # logtext "Result: blkid binary not found, trying by checking device listing"
+ # if [ -f /dev/disk/by-uuid/${UUID} ]; then
+ # logtext "Result: found disk via /dev/disk/by-uuid listing"
+ # fi
+ # fi
report "swap_partition[]=${I}"
done
if [ ${FOUND} -eq 1 ]; then
@@ -212,7 +223,7 @@
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")) print $1 }' /etc/fstab`
+ FIND=`awk '{ if ($3=="swap" && ($4!="sw" && $4!="swap" $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)"