IMP(5.2.3): fix possible permissions for 5.2.3

This commit is contained in:
Thibault Ayanides 2020-11-30 14:27:20 +01:00
parent d40a85085d
commit f4e0aafacc

View File

@ -29,6 +29,10 @@ audit () {
ok "$FILE permissions were set to $PERMISSIONS"
else
has_file_correct_permissions $FILE 640
if [ $FNRET = 0 ]; then
ok "$FILE permissions were set to $PERMISSIONS"
else
has_file_correct_permissions $FILE 600
if [ $FNRET = 0 ]; then
ok "$FILE permissions were set to $PERMISSIONS"
else
@ -36,6 +40,7 @@ audit () {
crit "$FILE permissions were not set to $PERMISSIONS"
fi
fi
fi
done
@ -70,6 +75,10 @@ apply () {
ok "$FILE permissions were set to $PERMISSIONS"
else
has_file_correct_permissions $FILE 640
if [ $FNRET = 0 ]; then
ok "$FILE permissions were set to $PERMISSIONS"
else
has_file_correct_permissions $FILE 600
if [ $FNRET = 0 ]; then
ok "$FILE permissions were set to $PERMISSIONS"
else
@ -77,6 +86,7 @@ apply () {
chmod 0$PERMISSIONS $FILE
fi
fi
fi
done
for FILE in $($SUDO_CMD find $DIR -xdev -type f -name 'ssh_host_*_key.pub');