Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Boelen <michael.boelen@cisofy.com>2019-12-13 14:34:56 +0300
committerMichael Boelen <michael.boelen@cisofy.com>2019-12-13 14:34:56 +0300
commitfd84be485b39f49b411c4e9744864119be954d82 (patch)
treee48887830e860df1835caf7b7859cc4fd280693e /include/functions
parentf00447fd1b5f340e78f5fd27d861089f6c48c8a7 (diff)
Improved permission check for BSD systems
Diffstat (limited to 'include/functions')
-rw-r--r--include/functions20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/functions b/include/functions
index 25a74552..9ed5fee7 100644
--- a/include/functions
+++ b/include/functions
@@ -1288,17 +1288,25 @@
# First try stat command
LogText "Test: checking if file ${CHECKFILE} is ${CHECK_PERMISSION}"
if [ -n "${STATBINARY}" ]; then
- # busybox does not support format
- if [ ${SHELL_IS_BUSYBOX} -eq 0 ]; then
- DATA=$(${STATBINARY} --format=%a ${CHECKFILE})
- fi
+
+ case ${OS} in
+ "*BSD")
+ 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
# See if we can use the find binary
if [ -z "${DATA}" ]; then
case ${OS} in
- "AIX")
- Debug "Skipping find command, as AIX does not support -printf"
+ "AIX" | "*BSD")
+ 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