From 80a651a19474c78b1b2716cbf8c85ffd78698823 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 6 Feb 2021 11:13:22 +0100 Subject: 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 . --- test.bash | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test.bash') 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 -- cgit v1.2.3