use octal representation of permissions

This commit is contained in:
Jérémy Lecour 2019-04-04 18:28:49 +02:00 committed by Jérémy Lecour
parent 7dab67e303
commit 0fa12b0cfd

View file

@ -500,16 +500,16 @@ if is_debian; then
if [ "$IS_NRPEPERMS" = 1 ]; then if [ "$IS_NRPEPERMS" = 1 ]; then
if [ -d /etc/nagios ]; then if [ -d /etc/nagios ]; then
actual=$(stat --format "%A" /etc/nagios) actual=$(stat --format "%a" /etc/nagios)
expected="drwxr-x---" expected="750"
test "$expected" = "$actual" || failed "IS_NRPEPERMS" test "$expected" = "$actual" || failed "IS_NRPEPERMS"
fi fi
fi fi
if [ "$IS_MINIFWPERMS" = 1 ]; then if [ "$IS_MINIFWPERMS" = 1 ]; then
if [ -f "$MINIFW_FILE" ]; then if [ -f "$MINIFW_FILE" ]; then
actual=$(stat --format "%A" $MINIFW_FILE) actual=$(stat --format "%a" $MINIFW_FILE)
expected="-rw-------" expected="600"
test "$expected" = "$actual" || failed "IS_MINIFWPERMS" test "$expected" = "$actual" || failed "IS_MINIFWPERMS"
fi fi
fi fi
@ -1378,20 +1378,20 @@ if is_openbsd; then
fi fi
if [ "$IS_TMP_1777" = 1 ]; then if [ "$IS_TMP_1777" = 1 ]; then
actual=$(stat --format "%A" /tmp) actual=$(stat --format "%a" /tmp)
expected="drwxrwxrwt" expected="1777"
test "$expected" = "$actual" || failed "IS_TMP_1777" test "$expected" = "$actual" || failed "IS_TMP_1777"
fi fi
if [ "$IS_ROOT_0700" = 1 ]; then if [ "$IS_ROOT_0700" = 1 ]; then
actual=$(stat --format "%A" /root) actual=$(stat --format "%a" /root)
expected="drwx------" expected="700"
test "$expected" = "$actual" || failed "IS_ROOT_0700" test "$expected" = "$actual" || failed "IS_ROOT_0700"
fi fi
if [ "$IS_USRSHARESCRIPTS" = 1 ]; then if [ "$IS_USRSHARESCRIPTS" = 1 ]; then
actual=$(stat --format "%A" /usr/share/scripts) actual=$(stat --format "%a" /usr/share/scripts)
expected="drwx------" expected="700"
test "$expected" = "$actual" || failed "IS_USRSHARESCRIPTS" test "$expected" = "$actual" || failed "IS_USRSHARESCRIPTS"
fi fi