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-30 20:09:03 +0300
committermboelen <michael@cisofy.com>2014-10-30 20:09:03 +0300
commitc8189d05e8c72f647bcdbe31acdbbf5da6db32e5 (patch)
tree28853c9956e73ed02ae5d29223318bdd80bce449
parentd02d8af6e8612124922f73ee5270db2853d17fe2 (diff)
Improvements for file systems, with focus on ext2, ext3 and ext4
-rw-r--r--include/tests_filesystems14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/tests_filesystems b/include/tests_filesystems
index 49ad559b..155d4cd4 100644
--- a/include/tests_filesystems
+++ b/include/tests_filesystems
@@ -151,8 +151,11 @@
FILESYSTEM=`echo ${I} | cut -d ',' -f1`
FILETYPE=`echo ${I} | cut -d ',' -f2`
logtext "File system: ${FILESYSTEM} (type: ${FILETYPE})"
- report "filesystem_ext[]=${FILESYSTEM|${FILETYPE}|"
+ report "file_systems_ext[]=${FILESYSTEM}|${FILETYPE}|"
done
+ else
+ logtext "Result: no EXT file systems found"
+ report "file_systems_ext[]=none"
fi
fi
#
@@ -362,7 +365,7 @@
if [ ${SKIPTEST} -eq 0 ]; then
FOUND=0
logtext "Test: Checking acl option on root file system"
- FIND=`mount | ${AWKBINARY} '{ if ($3=="/") { print $6 } }' | grep acl`
+ FIND=`mount | ${AWKBINARY} '{ if ($3=="/" && $5~/ext[2-4]/) { print $6 } }' | grep acl`
if [ ! "${FIND}" = "" ]; then
logtext "Result: found ACL option"
FOUND=1
@@ -374,12 +377,15 @@
if [ -b /dev/root ]; then
FIND1="/dev/root"
else
- FIND1=`mount | grep 'on / ' | awk '{ print $1 }' | sed 's/rootfs//'`
+ # Only determine device if it is EXT2/3/4
+ #FIND1=`mount | grep "on / " | awk '{ if ($5~/ext[2-4]/) { print $1 }}'`
+ FIND1=`mount -t ext2,ext3,ext4 | grep "on / " | awk '{ print $1 }'`
fi
+ # Trying to determine default mount options from EXT2/EXT3/EXT4 file systems
if [ ! "${FIND1}" = "" ]; then
logtext "Result: found ${FIND1}"
logtext "Test: Checking default options on ${FIND1}"
- FIND2=`${TUNE2FSBINARY} -l ${FIND1} 2> /dev/null | grep "^Default mount options" | grep "acl"`
+ FIND2=`${TUNE2FSBINARY} -l ${FIND1} 2> /dev/null | grep "^Default mount options" | grep "acl"`
if [ ! "${FIND2}" = "" ]; then
logtext "Result: found ACL option in default mount options"
FOUND=1