mirror of https://github.com/CISOfy/lynis.git
Fix grep in PROFILEVALUE
Make it work with new profile format
This commit is contained in:
parent
4d5a0c59c7
commit
b8a0190e82
|
@ -208,10 +208,10 @@
|
|||
# If 'file' is an directory, use -d
|
||||
if [ -d ${CHECKFILE} ]; then
|
||||
FILEVALUE=$(ls -d -l ${CHECKFILE} | cut -c 2-10)
|
||||
PROFILEVALUE=$(grep '^permdir' ${PROFILE} | grep ":${CHECKFILE}:" | cut -d: -f3)
|
||||
PROFILEVALUE=$(grep '^permdir' ${PROFILE} | grep "=${CHECKFILE}:" | cut -d: -f2)
|
||||
else
|
||||
FILEVALUE=$(ls -l ${CHECKFILE} | cut -c 2-10)
|
||||
PROFILEVALUE=$(grep '^permfile' ${PROFILE} | grep ":${CHECKFILE}:" | cut -d: -f3)
|
||||
PROFILEVALUE=$(grep '^permfile' ${PROFILE} | grep "=${CHECKFILE}:" | cut -d: -f2)
|
||||
fi
|
||||
if [ "${FILEVALUE}" = "${PROFILEVALUE}" ]; then PERMS="OK"; else PERMS="BAD"; fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue