mirror of https://github.com/CISOfy/lynis.git
Merge pull request #732 from Marzal/Marzal-FILE-7524
Changes for new profile format
This commit is contained in:
commit
2ec0268692
|
@ -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
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
LogText "Test: Checking file permissions"
|
||||
for PROFILE in ${PROFILES}; do
|
||||
LogText "Using profile ${PROFILE} for baseline."
|
||||
FIND=$(${EGREPBINARY} '^permfile=|^permdir=' ${PROFILE} | ${CUTBINARY} -d= -f2)
|
||||
FIND=$(${EGREPBINARY} '^permfile=|^permdir=' ${PROFILE} | ${CUTBINARY} -d= -f2 | ${CUTBINARY} -d: -f1)
|
||||
for I in ${FIND}; do
|
||||
LogText "Checking ${I}"
|
||||
CheckFilePermissions "${I}"
|
||||
|
|
Loading…
Reference in New Issue