summaryrefslogtreecommitdiff
path: root/test.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-12-08 18:53:15 +0100
committerJakob Unterwurzacher2021-12-08 18:53:15 +0100
commita48d6c30410753eb16ae94e6bfc54ca7abb7d128 (patch)
tree717d900a0e3e0e6529d94bc72b8c9650db9f54b7 /test.bash
parentec186c13cebeea48112aa9a863c278ffc23db197 (diff)
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
Diffstat (limited to 'test.bash')
-rwxr-xr-xtest.bash8
1 files changed, 8 insertions, 0 deletions
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"