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-07-31 18:35:35 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2016-07-31 18:35:35 +0300
commit039a829457ab78a2f5660906a2be2b1244b7c091 (patch)
tree9f83730bde926fa6c6beb3ae4833b2e23aa03429
parent66a871a07af83ef52218dc95640236ec3c0baf77 (diff)
Style and readability improvements
-rw-r--r--include/tests_filesystems22
1 files changed, 11 insertions, 11 deletions
diff --git a/include/tests_filesystems b/include/tests_filesystems
index e048a518..56bf5152 100644
--- a/include/tests_filesystems
+++ b/include/tests_filesystems
@@ -452,16 +452,16 @@
Register --test-no FILE-6372 --os Linux --weight L --network NO --category security --description "Checking / mount options"
if [ ${SKIPTEST} -eq 0 ]; then
if [ -f /etc/fstab ]; then
- FIND=`cat /etc/fstab | grep -v "^#" | awk '{ if ($2=="/") { print $4 } }'`
- NODEV=`echo ${FIND} | awk '{ if ($1 ~ "nodev") { print "YES" } else { print "NO" } }'`
- NOEXEC=`echo ${FIND} | awk '{ if ($1 ~ "noexec") { print "YES" } else { print "NO" } }'`
- NOSUID=`echo ${FIND} | awk '{ if ($1 ~ "nosuid") { print "YES" } else { print "NO" } }'`
+ FIND=$(awk '{ if ($2=="/") { print $4 } }' /etc/fstab | grep -v "^#")
+ NODEV=$(echo ${FIND} | awk '{ if ($1 ~ "nodev") { print "YES" } else { print "NO" } }')
+ NOEXEC=$(echo ${FIND} | awk '{ if ($1 ~ "noexec") { print "YES" } else { print "NO" } }')
+ NOSUID=$(echo ${FIND} | awk '{ if ($1 ~ "nosuid") { print "YES" } else { print "NO" } }')
if [ ! "${FIND}" = "" ]; then
LogText "Result: mount system / is configured with options: ${FIND}"
if [ "${FIND}" = "defaults" ]; then
Display --indent 2 --text "- Mount options of /" --result "${STATUS_OK}" --color GREEN
- else
+ else
Display --indent 2 --text "- Mount options of /" --result "NON DEFAULT" --color YELLOW
fi
else
@@ -497,11 +497,11 @@
if [ ${SKIPTEST} -eq 0 ]; then
if [ -f /etc/fstab ]; then
for I in ${FILESYSTEMS_TO_CHECK}; do
- FILESYSTEM=`echo ${I} | cut -d: -f1`
- EXPECTED_FLAGS=`echo ${I} | cut -d: -f2 | sed 's/,/ /g'`
- IN_FSTAB=`cat /etc/fstab | awk -v fs=${FILESYSTEM} '{ if ($2==fs) { print "FOUND" } }'`
+ FILESYSTEM=$(echo ${I} | cut -d: -f1)
+ EXPECTED_FLAGS=$(echo ${I} | cut -d: -f2 | sed 's/,/ /g')
+ IN_FSTAB=$(awk -v fs=${FILESYSTEM} '{ if ($2==fs) { print "FOUND" } }' /etc/fstab)
if [ ! "${IN_FSTAB}" = "" ]; then
- FOUND_FLAGS=`cat /etc/fstab | awk -v fs=${FILESYSTEM} '{ if ($2==fs) { print $4 } }' | sed 's/,/ /g'`
+ FOUND_FLAGS=$(awk -v fs=${FILESYSTEM} '{ if ($2==fs) { print $4 } }' /etc/fstab | sed 's/,/ /g')
LogText "File system: ${FILESYSTEM}"
LogText "Expected flags: ${EXPECTED_FLAGS}"
LogText "Found flags: ${FOUND_FLAGS}"
@@ -550,8 +550,8 @@
Register --test-no FILE-6376 --os Linux --weight L --network NO --category security --description "Determine if /var/tmp is bound to /tmp"
if [ ${SKIPTEST} -eq 0 ]; then
if [ -f /etc/fstab ]; then
- FIND=`awk '{ if ($2=="/var/tmp") { print $4 } }' /etc/fstab`
- BIND=`echo ${FIND} | awk '{ if ($1 ~ "bind") { print "YES" } else { print "NO" } }'`
+ FIND=$(awk '{ if ($2=="/var/tmp") { print $4 } }' /etc/fstab)
+ BIND=$(echo ${FIND} | awk '{ if ($1 ~ "bind") { print "YES" } else { print "NO" } }')
if [ ! "${FIND}" = "" ]; then
LogText "Result: mount system /var/tmp is configured with options: ${FIND}"
if [ "${BIND}" = "YES" ]; then