aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2025-07-07 17:11:00 +0200
committerJakob Unterwurzacher2025-07-07 17:11:00 +0200
commitcdb80ea9825d2e876f1cf579bf960e4da7656b4c (patch)
treea783aeae333c02c8cdbca5dd0465b6fd9dfbb002
parentba222871c1bf70cad56ac2ddbae8728154e9137b (diff)
test.bash: don't descend into vendor dir
Before: ./vendor/golang.org/x/sys/unix/syscall_linux.go: return syscall.Setuid(uid) ./vendor/golang.org/x/sys/unix/syscall_linux.go: return syscall.Setgid(gid) ./vendor/golang.org/x/sys/unix/syscall_linux.go: return syscall.Setreuid(ruid, euid) ./vendor/golang.org/x/sys/unix/syscall_linux.go: return syscall.Setregid(rgid, egid) ./vendor/golang.org/x/sys/unix/syscall_linux.go: return syscall.Setresuid(ruid, euid, suid) ./vendor/golang.org/x/sys/unix/syscall_linux.go: return syscall.Setresgid(rgid, egid, sgid) test.bash: This affects the whole process. Please use the syscallcompat wrappers instead. After: clean https://github.com/rfjakob/gocryptfs/issues/930
-rwxr-xr-xtest.bash4
1 files changed, 2 insertions, 2 deletions
diff --git a/test.bash b/test.bash
index d701f76..2b78d17 100755
--- a/test.bash
+++ b/test.bash
@@ -112,13 +112,13 @@ fi
# Both syscall.Setreuid etc (since 2020, https://github.com/golang/go/commit/d1b1145cace8b968307f9311ff611e4bb810710c)
# and unix.Setreuid etc (since 2022, https://github.com/golang/sys/commit/d0df966e6959f00dc1c74363e537872647352d51)
# affect the whole process, not only the current thread, which is what we do NOT want.
-if find . -type f -name \*.go -print0 | xargs -0 grep -v -E '^//' |
+if find . ! -path "./vendor/*" -type f -name \*.go -print0 | xargs -0 grep -v -E '^//' |
grep -E '(syscall|unix).(Setegid|Seteuid|Setgroups|Setgid|Setregid|Setreuid|Setresgid|Setresuid|Setuid)\(' ; then
echo "$MYNAME: This affects the whole process. Please use the syscallcompat wrappers instead."
exit 1
fi
-if find . -type f -name \*.go -print0 | xargs -0 grep '\.Creat('; then
+if find . ! -path "./vendor/*" -type f -name \*.go -print0 | xargs -0 grep '\.Creat('; then
# MacOS does not have syscall.Creat(). Creat() is equivalent to Open(..., O_CREAT|O_WRONLY|O_TRUNC, ...),
# but usually you want O_EXCL instead of O_TRUNC because it is safer, so that's what we suggest
# instead.