From a48d6c30410753eb16ae94e6bfc54ca7abb7d128 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 8 Dec 2021 18:53:15 +0100 Subject: test.bash, crossbuild: catch MacOS test build failures Regression test for https://github.com/rfjakob/gocryptfs/issues/623 Fixes https://github.com/rfjakob/gocryptfs/issues/623 --- test.bash | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test.bash') diff --git a/test.bash b/test.bash index efc6456..6289072 100755 --- a/test.bash +++ b/test.bash @@ -93,4 +93,12 @@ if find . -type f -name \*.go -print0 | xargs -0 grep -E 'syscall.(Setegid|Seteu exit 1 fi +if find . -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. + echo "$MYNAME: Please use Open(..., O_CREAT|O_WRONLY|O_EXCL, ...) instead of Creat()! https://github.com/rfjakob/gocryptfs/issues/623" + exit 1 +fi + ) 200> "$LOCKFILE" -- cgit v1.2.3