mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-21 18:25:41 +03:00
19 lines
970 B
Diff
19 lines
970 B
Diff
On the Alpine CI our moby configuration returns ENOSYS instead of EPERM
|
|
when attempting to use the unshare(2) system call from a container. The
|
|
Go test suite expects unshare(2) to return EPERM in this scenario and
|
|
skips tests using it when it does. By treating the ENOSYS errno in the
|
|
same way as the EPERM errno we can ensure that the Go test suite
|
|
continues to work on the Alpine CI.
|
|
|
|
diff -upr go.orig/src/runtime/testdata/testprog/syscalls_linux.go go/src/runtime/testdata/testprog/syscalls_linux.go
|
|
--- go.orig/src/runtime/testdata/testprog/syscalls_linux.go 2021-03-11 18:14:31.000000000 +0100
|
|
+++ go/src/runtime/testdata/testprog/syscalls_linux.go 2021-03-12 17:26:10.927644763 +0100
|
|
@@ -46,7 +46,7 @@ func unshareFs() error {
|
|
err := syscall.Unshare(syscall.CLONE_FS)
|
|
if err != nil {
|
|
errno, ok := err.(syscall.Errno)
|
|
- if ok && errno == syscall.EPERM {
|
|
+ if ok && (errno == syscall.EPERM || errno == syscall.ENOSYS) {
|
|
return errNotPermitted
|
|
}
|
|
}
|