mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-25 23:05:01 +02:00
FILE-xyzz : Bind mount the /var/tmp directory to /tmp (#193)
Check if a bind mount is done between /var/tmp and the directory /tmp
This commit is contained in:
parent
8ba1f51c19
commit
125f704a10
@ -542,6 +542,35 @@
|
|||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
#
|
||||||
|
# Test : FILE-xyzz
|
||||||
|
# Description : Bind mount the /var/tmp directory to /tmp
|
||||||
|
#
|
||||||
|
#################################################################################
|
||||||
|
#
|
||||||
|
Register --test-no FILE-xyzz --os Linux --weight L --network NO --description "Checking /var/tmp is bind to /tmp"
|
||||||
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
|
if [ -f /etc/fstab ]; then
|
||||||
|
FIND=`cat /etc/fstab | awk '{ if ($2=="/var/tmp") { print $4 } }'`
|
||||||
|
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
|
||||||
|
Display --indent 2 --text "- /var/tmp is bind to /tmp" --result OK --color GREEN
|
||||||
|
LogText "Result : /var/tmp is bind to /tmp"
|
||||||
|
else
|
||||||
|
Display --indent 2 --text "- /var/tmp is not bind to /tmp" --result "NON DEFAULT" --color RED
|
||||||
|
LogText "Result: /var/tmp is not bind to /tmp"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
LogText "Result: no mount point /var/tmp or expected options found"
|
||||||
|
Display --indent 2 --text "- /var/tmp is not bind to /tmp" --result "NON DEFAULT" --color RED
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
#
|
||||||
|
#################################################################################
|
||||||
#
|
#
|
||||||
# Test : FILE-6378
|
# Test : FILE-6378
|
||||||
# Description : Check for nodirtime option
|
# Description : Check for nodirtime option
|
||||||
|
Loading…
x
Reference in New Issue
Block a user