mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-25 06:45:14 +02:00
[FILE-6332] Enable testing for UUID usage with blkid command
This commit is contained in:
parent
220476d955
commit
c74c572422
@ -221,21 +221,21 @@
|
|||||||
REAL=""
|
REAL=""
|
||||||
UUID=""
|
UUID=""
|
||||||
LogText "Swap partition found: ${I}"
|
LogText "Swap partition found: ${I}"
|
||||||
# YYY Add a test if partition is not a normal partition (e.g. UUID=)
|
# TODO Add a test if partition is not a normal partition (e.g. UUID=)
|
||||||
# Can be ^/dev/mapper/vg-name_lv-name
|
# Can be ^/dev/mapper/vg-name_lv-name
|
||||||
# Can be ^/dev/partition
|
# Can be ^/dev/partition
|
||||||
|
|
||||||
# Can be ^UUID=uuid --> /dev/disk/by-uuid/<uuid>
|
# Test for UUID usage (e.g. UUID=uuid --> /dev/disk/by-uuid/<uuid>)
|
||||||
HAS_UUID=`echo ${I} | grep "^UUID="`
|
HAS_UUID=`echo ${I} | grep "^UUID="`
|
||||||
if [ ! "${HAS_UUID}" = "" ]; then
|
if [ ! "${HAS_UUID}" = "" ]; then
|
||||||
UUID=`echo ${HAS_UUID} | awk -F= '{ print $2 }'`
|
UUID=`echo ${HAS_UUID} | awk -F= '{ print $2 }'`
|
||||||
LogText "Result: Using ${UUID} as UUID"
|
LogText "Result: Using ${UUID} as UUID"
|
||||||
if [ ! "${BLKIDBINARYx}" = "" ]; then
|
if [ ! "${BLKIDBINARY}" = "" ]; then
|
||||||
FIND2=`${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//'`
|
FIND2=$(${BLKIDBINARY} | awk '{ if ($2=="UUID=\"${UUID}\"") print $1 }' | sed 's/:$//')
|
||||||
if [ ! "${FIND2}" = "" ]; then
|
if [ ! "${FIND2}" = "" ]; then
|
||||||
REAL="${FIND2}"
|
REAL="${FIND2}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LogText "Result: blkid binary not found, trying by checking device listing"
|
LogText "Result: blkid binary not found, trying by checking device listing"
|
||||||
sFILE=""
|
sFILE=""
|
||||||
if [ -L /dev/disk/by-uuid/${UUID} ]; then
|
if [ -L /dev/disk/by-uuid/${UUID} ]; then
|
||||||
@ -245,7 +245,7 @@
|
|||||||
REAL="${sFILE}"
|
REAL="${sFILE}"
|
||||||
LogText "Result: disk is ${REAL}"
|
LogText "Result: disk is ${REAL}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LogText "Result: no symlink found to /dev/disk/by-uuid/${UUID}"
|
LogText "Result: no symlink found to /dev/disk/by-uuid/${UUID}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user