summaryrefslogtreecommitdiff
path: root/test.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-02-06 11:13:22 +0100
committerJakob Unterwurzacher2021-02-06 11:38:25 +0100
commit80a651a19474c78b1b2716cbf8c85ffd78698823 (patch)
treea5c83754a197c789c26e5a15bf24707a1cd9113e /test.bash
parent3ab1bcf1c5aacafe4339564ff0a09c349d3201a0 (diff)
syscallcompat: MknodatUser: work around changed syscall.Setgroups semantics
Since go1.16beta1 (commit d1b1145cace8b968307f9311ff611e4bb810710c , https://go-review.googlesource.com/c/go/+/210639 ) syscall.{Setgroups,Setregid,Setreuid} affects all threads, which is exactly what we not want. We now use unix.{Setgroups,Setregid,Setreuid} instead. Workarounds https://github.com/golang/go/issues/1435 .
Diffstat (limited to 'test.bash')
-rwxr-xr-xtest.bash9
1 files changed, 8 insertions, 1 deletions
diff --git a/test.bash b/test.bash
index ce2d392..266a875 100755
--- a/test.bash
+++ b/test.bash
@@ -80,7 +80,14 @@ else
fi
if grep -R "panic(" ./*.go internal ; then
- echo "Please use log.Panic instead of naked panic!"
+ echo "$MYNAME: Please use log.Panic instead of naked panic!"
+ exit 1
+fi
+
+# All functions from the commit msg in https://go-review.googlesource.com/c/go/+/210639
+if grep -R -E 'syscall.(Setegid|Seteuid|Setgroups|Setgid|Setregid|Setreuid|Setresgid|Setresuid|Setuid)\(' \
+ ./*.go internal ; then
+ echo "$MYNAME: You probably want to use unix.Setgroups and friends. See the comments in OpenatUser() for why."
exit 1
fi