-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go1.21 already has the fifth minor revision (released 2023-12-05) and should therefore already be sufficiently stable. Furthermore we need it to fix a bug in a NEO/go dependency [1]. Please find all details in the official release note: https://go.dev/doc/go1.21 It was released on 2023-08-08 [2]. Due to the go promise of compatibility most software should still compile without any problems. In golang < 1.21 we needed to patch golang to fix golang/go#42525. In golang 1.21 we still need to apply a fix, but can't apply the old patch because the code changed. In golang > 1.21 this problem is already fixed with https://go-review.googlesource.com/c/go/+/520055. Because of golang/go@0926714 'TestUnshareMountNameSpace' fails on golang 1.21 [3]. In golang 1.20 this test was skipped [4]. To fix this failure the additional patch 'skip-unshare-mount-test.patch' has been added. --- [1] https://lab.nexedi.com/nexedi/wendelin.core/merge_requests/22#note_195769] [2] https://go.dev/doc/devel/release [3] --- FAIL: TestUnshareMountNameSpace (0.18s) exec_linux_test.go:243: unshare failed: exit status 2 unshare: mount /tmp/TestUnshareMountNameSpace2210137852/001 failed: 0x1 [4] === RUN TestUnshareMountNameSpace exec_linux_test.go:333: kernel prohibits unshare in unprivileged process, unless using user namespace — SKIP: TestUnshareMountNameSpace (0.00s) /reviewed-by @kirr and @jerome /reviewed-on https://lab.nexedi.com/nexedi/slapos/merge_requests/1494
- Loading branch information
1 parent
02a69bf
commit 995dd3c
Showing
3 changed files
with
119 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
component/golang/os-skip-Chown-tests-for-auxiliary-groups-that-fail-d.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
From 9f03e8367d85d75675b2f2e90873e3293799d8aa Mon Sep 17 00:00:00 2001 | ||
From: "Bryan C. Mills" <[email protected]> | ||
Date: Tue, 15 Aug 2023 18:01:16 -0400 | ||
Subject: [PATCH] os: skip Chown tests for auxiliary groups that fail due to | ||
permission errors | ||
|
||
This addresses the failure mode described in | ||
https://git.alpinelinux.org/aports/commit/community/go/tests-filter-overflow-gid.patch?id=9851dde0f5d2a5a50f7f3b5323d1b2ff22e1d028, | ||
but without special-casing an implementation-specific group ID. | ||
|
||
For #62053. | ||
|
||
Change-Id: I70b1046837b8146889fff7085497213349cd2bf0 | ||
Reviewed-on: https://go-review.googlesource.com/c/go/+/520055 | ||
Reviewed-by: Ian Lance Taylor <[email protected]> | ||
TryBot-Result: Gopher Robot <[email protected]> | ||
Run-TryBot: Bryan Mills <[email protected]> | ||
Auto-Submit: Bryan Mills <[email protected]> | ||
--- | ||
src/os/os_unix_test.go | 22 ++++++++++++++++++++++ | ||
1 file changed, 22 insertions(+) | ||
|
||
diff --git a/src/os/os_unix_test.go b/src/os/os_unix_test.go | ||
index 9041b25471..e4271ff905 100644 | ||
--- a/src/os/os_unix_test.go | ||
+++ b/src/os/os_unix_test.go | ||
@@ -75,6 +75,12 @@ func TestChown(t *testing.T) { | ||
t.Log("groups: ", groups) | ||
for _, g := range groups { | ||
if err = Chown(f.Name(), -1, g); err != nil { | ||
+ if testenv.SyscallIsNotSupported(err) { | ||
+ t.Logf("chown %s -1 %d: %s (error ignored)", f.Name(), g, err) | ||
+ // Since the Chown call failed, the file should be unmodified. | ||
+ checkUidGid(t, f.Name(), int(sys.Uid), gid) | ||
+ continue | ||
+ } | ||
t.Fatalf("chown %s -1 %d: %s", f.Name(), g, err) | ||
} | ||
checkUidGid(t, f.Name(), int(sys.Uid), g) | ||
@@ -123,6 +129,12 @@ func TestFileChown(t *testing.T) { | ||
t.Log("groups: ", groups) | ||
for _, g := range groups { | ||
if err = f.Chown(-1, g); err != nil { | ||
+ if testenv.SyscallIsNotSupported(err) { | ||
+ t.Logf("chown %s -1 %d: %s (error ignored)", f.Name(), g, err) | ||
+ // Since the Chown call failed, the file should be unmodified. | ||
+ checkUidGid(t, f.Name(), int(sys.Uid), gid) | ||
+ continue | ||
+ } | ||
t.Fatalf("fchown %s -1 %d: %s", f.Name(), g, err) | ||
} | ||
checkUidGid(t, f.Name(), int(sys.Uid), g) | ||
@@ -181,12 +193,22 @@ func TestLchown(t *testing.T) { | ||
t.Log("groups: ", groups) | ||
for _, g := range groups { | ||
if err = Lchown(linkname, -1, g); err != nil { | ||
+ if testenv.SyscallIsNotSupported(err) { | ||
+ t.Logf("lchown %s -1 %d: %s (error ignored)", f.Name(), g, err) | ||
+ // Since the Lchown call failed, the file should be unmodified. | ||
+ checkUidGid(t, f.Name(), int(sys.Uid), gid) | ||
+ continue | ||
+ } | ||
t.Fatalf("lchown %s -1 %d: %s", linkname, g, err) | ||
} | ||
checkUidGid(t, linkname, int(sys.Uid), g) | ||
|
||
// Check that link target's gid is unchanged. | ||
checkUidGid(t, f.Name(), int(sys.Uid), int(sys.Gid)) | ||
+ | ||
+ if err = Lchown(linkname, -1, gid); err != nil { | ||
+ t.Fatalf("lchown %s -1 %d: %s", f.Name(), gid, err) | ||
+ } | ||
} | ||
} | ||
|
||
-- | ||
2.36.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
https://github.com/golang/go/commit/092671423cd95eaa6df93eb29442fef41504d097 breaks | ||
TestUnshareMountNameSpace test on SlapOS. | ||
--- | ||
diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go | ||
index f4ff7bf81b..bc8bdb0a35 100644 | ||
--- a/src/syscall/exec_linux_test.go | ||
+++ b/src/syscall/exec_linux_test.go | ||
@@ -206,6 +206,7 @@ func TestGroupCleanupUserNamespace(t *testing.T) { | ||
// Test for https://go.dev/issue/19661: unshare fails because systemd | ||
// has forced / to be shared | ||
func TestUnshareMountNameSpace(t *testing.T) { | ||
+ t.Skip("skipping: not supported in SlapOS") | ||
testenv.MustHaveExec(t) | ||
|
||
if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" { |