mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-22 13:24:32 +02:00
Readability and style improvements
This commit is contained in:
parent
9874530615
commit
3c46482a9e
@ -716,24 +716,24 @@
|
|||||||
LogText "Result: unclear if we can read this file, as this is a symlink"
|
LogText "Result: unclear if we can read this file, as this is a symlink"
|
||||||
ReportException "FileIsReadable" "Can not determine symlink ${sFILE}"
|
ReportException "FileIsReadable" "Can not determine symlink ${sFILE}"
|
||||||
elif [ -d ${sFILE} ]; then
|
elif [ -d ${sFILE} ]; then
|
||||||
OTHERPERMS=`ls -d -l ${sFILE} | cut -c 8`
|
OTHERPERMS=$(ls -d -l ${sFILE} | cut -c 8)
|
||||||
elif [ -f ${sFILE} ]; then
|
elif [ -f ${sFILE} ]; then
|
||||||
OTHERPERMS=`ls -d -l ${sFILE} | cut -c 8`
|
OTHERPERMS=$(ls -d -l ${sFILE} | cut -c 8)
|
||||||
else
|
else
|
||||||
OTHERPERMS="-"
|
OTHERPERMS="-"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Also check if we are the actual owner of the file (use -d to get directory itself, if its a directory)
|
# Also check if we are the actual owner of the file (use -d to get directory itself, if its a directory)
|
||||||
FILEOWNER=`ls -dln ${sFILE} | awk -F" " '{ print $3 }'`
|
FILEOWNER=$(ls -dln ${sFILE} | awk -F" " '{ print $3 }')
|
||||||
if [ "${FILEOWNER}" = "${MYID}" ]; then
|
if [ "${FILEOWNER}" = "${MYID}" ]; then
|
||||||
LogText "Result: file is owned by our current user ID (${MYID}), checking if it is readable"
|
LogText "Result: file is owned by our current user ID (${MYID}), checking if it is readable"
|
||||||
if [ -L ${sFILE} ]; then
|
if [ -L ${sFILE} ]; then
|
||||||
LogText "Result: unclear if we can read this file, as this is a symlink"
|
LogText "Result: unclear if we can read this file, as this is a symlink"
|
||||||
ReportException "FileIsReadable" "Can not determine symlink ${sFILE}"
|
ReportException "FileIsReadable" "Can not determine symlink ${sFILE}"
|
||||||
elif [ -d ${sFILE} ]; then
|
elif [ -d ${sFILE} ]; then
|
||||||
OTHERPERMS=`ls -d -l ${sFILE} | cut -c 2`
|
OTHERPERMS=$(ls -d -l ${sFILE} | cut -c 2)
|
||||||
elif [ -f ${sFILE} ]; then
|
elif [ -f ${sFILE} ]; then
|
||||||
OTHERPERMS=`ls -d -l ${sFILE} | cut -c 2`
|
OTHERPERMS=$(ls -d -l ${sFILE} | cut -c 2)
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
LogText "Result: file is not owned by current user ID (${MYID}), but UID ${FILEOWNER}"
|
LogText "Result: file is not owned by current user ID (${MYID}), but UID ${FILEOWNER}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user