mirror of https://github.com/CISOfy/lynis.git
Improved permission check for BSD systems
This commit is contained in:
parent
f00447fd1b
commit
fd84be485b
|
@ -1288,17 +1288,25 @@
|
||||||
# First try stat command
|
# First try stat command
|
||||||
LogText "Test: checking if file ${CHECKFILE} is ${CHECK_PERMISSION}"
|
LogText "Test: checking if file ${CHECKFILE} is ${CHECK_PERMISSION}"
|
||||||
if [ -n "${STATBINARY}" ]; then
|
if [ -n "${STATBINARY}" ]; then
|
||||||
# busybox does not support format
|
|
||||||
if [ ${SHELL_IS_BUSYBOX} -eq 0 ]; then
|
case ${OS} in
|
||||||
DATA=$(${STATBINARY} --format=%a ${CHECKFILE})
|
"*BSD")
|
||||||
fi
|
DATA=$(${STATBINARY} -f "%OLp" ${CHECKFILE})
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# busybox does not support format
|
||||||
|
if [ ${SHELL_IS_BUSYBOX} -eq 0 ]; then
|
||||||
|
DATA=$(${STATBINARY} --format=%a ${CHECKFILE})
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# See if we can use the find binary
|
# See if we can use the find binary
|
||||||
if [ -z "${DATA}" ]; then
|
if [ -z "${DATA}" ]; then
|
||||||
case ${OS} in
|
case ${OS} in
|
||||||
"AIX")
|
"AIX" | "*BSD")
|
||||||
Debug "Skipping find command, as AIX does not support -printf"
|
Debug "Skipping find command, as this operating system does not support -printf parameter"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Only use find when OS is NOT AIX and binaries are NOT busybox
|
# Only use find when OS is NOT AIX and binaries are NOT busybox
|
||||||
|
|
Loading…
Reference in New Issue