more permissions check with stat

This commit is contained in:
Jérémy Lecour 2019-03-22 00:00:49 +01:00
parent 057cb7026a
commit 9dcdd8202e

View file

@ -403,13 +403,17 @@ if is_debian; then
fi
if [ "$IS_NRPEPERMS" = 1 ]; then
test -d /etc/nagios && ls -ld /etc/nagios | grep -q "drwxr-x---" \
|| failed "IS_NRPEPERMS"
if test -d /etc/nagios; then
actual=$(stat --format "%A" /etc/nagios)
expected="drwxr-x---"
test "$expected" = "$actual" || failed "IS_NRPEPERMS"
fi
fi
if [ "$IS_MINIFWPERMS" = 1 ]; then
ls -l "$MINIFW_FILE" | grep -q -- "-rw-------" \
|| failed "IS_MINIFWPERMS"
actual=$(stat --format "%A" $MINIFW_FILE)
expected="-rw-------"
test "$expected" = "$actual" || failed "IS_MINIFWPERMS"
fi
if [ "$IS_NRPEDISKS" = 1 ]; then