mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-25 23:11:24 +01:00
IMP(4.2.4): use functions in utils
This commit is contained in:
parent
258da6b4a1
commit
ccef85ebe3
@ -22,11 +22,12 @@ audit () {
|
|||||||
ERRORS=0
|
ERRORS=0
|
||||||
for FILE in $($SUDO_CMD find $DIR -type f);
|
for FILE in $($SUDO_CMD find $DIR -type f);
|
||||||
do
|
do
|
||||||
perm=$(stat -L -c '%a' $FILE)
|
has_file_correct_permissions $FILE $PERMISSIONS
|
||||||
echo "$perm ttt $PERMISSIONS"
|
if [ $FNRET = 0 ]; then
|
||||||
if [ "$perm" != "$PERMISSIONS" ]; then
|
ok "$FILE permissions were set to $PERMISSIONS"
|
||||||
|
else
|
||||||
ERRORS=$((ERRORS+1))
|
ERRORS=$((ERRORS+1))
|
||||||
crit "Some logs in $DIR permissions were not set to $PERMISSIONS"
|
crit "$FILE permissions were not set to $PERMISSIONS"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -40,12 +41,12 @@ apply () {
|
|||||||
ERRORS=0
|
ERRORS=0
|
||||||
for FILE in $($SUDO_CMD find $DIR -type f);
|
for FILE in $($SUDO_CMD find $DIR -type f);
|
||||||
do
|
do
|
||||||
perm=$(stat -L -c '%a' $FILE)
|
has_file_correct_permissions $FILE $PERMISSIONS
|
||||||
echo "$perm ttt $PERMISSIONS"
|
if [ $FNRET = 0 ]; then
|
||||||
if [ "$perm" != "$PERMISSIONS" ]; then
|
ok "$FILE permissions were set to $PERMISSIONS"
|
||||||
info "fixing $DIR logs permissions to $PERMISSIONS"
|
else
|
||||||
|
warn "fixing $DIRlogs ownership to $PERMISSIONS"
|
||||||
chmod 0$PERMISSIONS $FILE
|
chmod 0$PERMISSIONS $FILE
|
||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user