mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-22 02:33:42 +02:00
4.2.4_logs_permissions
This commit is contained in:
16
lib/utils.sh
16
lib/utils.sh
@ -88,13 +88,27 @@ has_file_correct_permissions() {
|
||||
local FILE=$1
|
||||
local PERMISSIONS=$2
|
||||
|
||||
if [ $($SUDO_CMD stat -L -c "%a" $1) = "$PERMISSIONS" ]; then
|
||||
if [ $($SUDO_CMD stat -L -c "%a" $FILE) = "$PERMISSIONS" ]; then
|
||||
FNRET=0
|
||||
else
|
||||
FNRET=1
|
||||
fi
|
||||
}
|
||||
|
||||
have_files_in_dir_correct_permissions(){
|
||||
local DIR=$1
|
||||
local PERMISSIONS=$2
|
||||
|
||||
FNRET=0
|
||||
for perm in $($SUDO_CMD find "$DIR" -type f -exec stat -L -c "%a" {} \;);
|
||||
do
|
||||
if [ "$perm" != "$PERMISSIONS" ]; then
|
||||
FNRET=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
does_pattern_exist_in_file_nocase() {
|
||||
_does_pattern_exist_in_file "-Ei" $*
|
||||
}
|
||||
|
Reference in New Issue
Block a user