fix(test): make stat command cross-platform in security tests

This commit is contained in:
m1ngsama 2026-02-07 14:47:53 +08:00
parent c120cb5ac5
commit 8a5ffb1722

View file

@ -67,7 +67,12 @@ if [ -f host_key ]; then
fi
# Check permissions
if [[ "$OSTYPE" == "darwin"* ]]; then
PERMS=$(stat -f "%OLp" host_key)
else
PERMS=$(stat -c "%a" host_key)
fi
if [ "$PERMS" = "600" ]; then
pass "Host key has secure permissions (600)"
else