From 5dca1e53d7fa0c2b7c15bbcec5654638727f9009 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 18 Apr 2021 09:42:43 +0200 Subject: [PATCH] config: only skip "invalid sticky" tests for non-root users --- cmd/safcm/config/files_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/safcm/config/files_test.go b/cmd/safcm/config/files_test.go index 6124e8a..da04bf9 100644 --- a/cmd/safcm/config/files_test.go +++ b/cmd/safcm/config/files_test.go @@ -47,8 +47,8 @@ func TestLoadFiles(t *testing.T) { } // Regular users cannot create sticky files - skipInvalidSticky := runtime.GOOS == "freebsd" || - runtime.GOOS == "openbsd" + skipInvalidSticky := os.Getuid() != 0 && + (runtime.GOOS == "freebsd" || runtime.GOOS == "openbsd") chmod("files-invalid-perm-dir/files", 0500) defer chmod("files-invalid-perm-dir/files", 0700) -- 2.45.2