From 8a5ffb17222bec938a0687eb7b45197ee8eb101f Mon Sep 17 00:00:00 2001 From: m1ngsama Date: Sat, 7 Feb 2026 14:47:53 +0800 Subject: [PATCH] fix(test): make stat command cross-platform in security tests --- tests/test_security_features.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_security_features.sh b/tests/test_security_features.sh index b141fbe..7f2cb39 100755 --- a/tests/test_security_features.sh +++ b/tests/test_security_features.sh @@ -67,7 +67,12 @@ if [ -f host_key ]; then fi # Check permissions - PERMS=$(stat -f "%OLp" host_key) + 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