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 fi
if [ "$IS_NRPEPERMS" = 1 ]; then if [ "$IS_NRPEPERMS" = 1 ]; then
test -d /etc/nagios && ls -ld /etc/nagios | grep -q "drwxr-x---" \ if test -d /etc/nagios; then
|| failed "IS_NRPEPERMS" actual=$(stat --format "%A" /etc/nagios)
expected="drwxr-x---"
test "$expected" = "$actual" || failed "IS_NRPEPERMS"
fi
fi fi
if [ "$IS_MINIFWPERMS" = 1 ]; then if [ "$IS_MINIFWPERMS" = 1 ]; then
ls -l "$MINIFW_FILE" | grep -q -- "-rw-------" \ actual=$(stat --format "%A" $MINIFW_FILE)
|| failed "IS_MINIFWPERMS" expected="-rw-------"
test "$expected" = "$actual" || failed "IS_MINIFWPERMS"
fi fi
if [ "$IS_NRPEDISKS" = 1 ]; then if [ "$IS_NRPEDISKS" = 1 ]; then