mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-22 18:53:42 +02:00
fix: ensure mountpoints are properly detected (#177)
Fixes #155 When real entries are present in fstab, system startup or runtime mountpoints are now properly detected Add a supplementary check in case of partition not present in fstab
This commit is contained in:
@ -424,6 +424,9 @@ is_a_partition() {
|
||||
if grep "[[:space:]]$1[[:space:]]" /etc/fstab | grep -vqE "^#"; then
|
||||
debug "$PARTITION found in fstab"
|
||||
FNRET=0
|
||||
elif mountpoint -q "$PARTITION"; then
|
||||
debug "$PARTITION found in /proc fs"
|
||||
FNRET=0
|
||||
else
|
||||
debug "Unable to find $PARTITION in fstab"
|
||||
FNRET=1
|
||||
@ -461,6 +464,9 @@ has_mount_option() {
|
||||
if grep "[[:space:]]${PARTITION}[[:space:]]" /etc/fstab | grep -vE "^#" | awk '{print $4}' | grep -q "$OPTION"; then
|
||||
debug "$OPTION has been detected in fstab for partition $PARTITION"
|
||||
FNRET=0
|
||||
elif mountpoint -q "$PARTITION"; then
|
||||
debug "$OPTION not detected in fstab, but $PARTITION is a mount point searching in /proc fs"
|
||||
has_mounted_option "$PARTITION" "$OPTION"
|
||||
else
|
||||
debug "Unable to find $OPTION in fstab for partition $PARTITION"
|
||||
FNRET=1
|
||||
|
Reference in New Issue
Block a user