aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/init_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-05 20:13:19 +0900
committerOphestra <cat@gensokyo.uk>2025-11-05 20:13:19 +0900
commit9fd97e71d0330d6b6509f28686cf53825bc80941 (patch)
tree35774cbde4c1abd9967a1de98341a732ff3b464f /container/init_test.go
parentfba201c9953a490da914b09e09eaaa697a4b36e1 (diff)
treewide: fit test untyped int literals in 32-bit
This enables hakurei test suite to run on 32-bit targets. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/init_test.go')
-rw-r--r--container/init_test.go449
1 files changed, 225 insertions, 224 deletions
diff --git a/container/init_test.go b/container/init_test.go
index 7ab4c917..336c7c48 100644
--- a/container/init_test.go
+++ b/container/init_test.go
@@ -1,6 +1,7 @@
package container
import (
+ "math"
"os"
"syscall"
"testing"
@@ -66,8 +67,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
SeccompRules: make([]std.NativeRule, 0),
SeccompPresets: std.PresetStrict,
@@ -90,8 +91,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: (*Ops)(sliceAddr(make(Ops, 1))),
SeccompRules: make([]std.NativeRule, 0),
@@ -118,8 +119,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: (*Ops)(sliceAddr(make(Ops, 1))),
SeccompRules: make([]std.NativeRule, 0),
@@ -130,7 +131,7 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, stub.UniqueError(75)),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, stub.UniqueError(75)),
call("fatalf", stub.ExpectArgs{"%v", []any{stub.UniqueError(75)}}, nil, nil),
},
}, nil},
@@ -147,8 +148,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: (*Ops)(sliceAddr(make(Ops, 1))),
SeccompRules: make([]std.NativeRule, 0),
@@ -159,7 +160,7 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, stub.UniqueError(73)),
call("fatalf", stub.ExpectArgs{"%v", []any{stub.UniqueError(73)}}, nil, nil),
},
@@ -177,8 +178,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: (*Ops)(sliceAddr(make(Ops, 1))),
SeccompRules: make([]std.NativeRule, 0),
@@ -189,9 +190,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, stub.UniqueError(71)),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, stub.UniqueError(71)),
call("fatalf", stub.ExpectArgs{"%v", []any{stub.UniqueError(71)}}, nil, nil),
},
}, nil},
@@ -208,8 +209,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: (*Ops)(sliceAddr(make(Ops, 1))),
SeccompRules: make([]std.NativeRule, 0),
@@ -220,9 +221,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, stub.UniqueError(69)),
call("fatalf", stub.ExpectArgs{"cannot set SUID_DUMP_DISABLE: %v", []any{stub.UniqueError(69)}}, nil, nil),
},
@@ -240,8 +241,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: (*Ops)(sliceAddr(make(Ops, 1))),
SeccompRules: make([]std.NativeRule, 0),
@@ -252,9 +253,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, stub.UniqueError(67)),
@@ -274,8 +275,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: (*Ops)(sliceAddr(make(Ops, 1))),
SeccompRules: make([]std.NativeRule, 0),
@@ -286,9 +287,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -310,8 +311,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: (*Ops)(sliceAddr(make(Ops, 1))),
SeccompRules: make([]std.NativeRule, 0),
@@ -322,9 +323,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -348,8 +349,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(nil, nil, std.BindDevice),
SeccompRules: make([]std.NativeRule, 0),
@@ -360,9 +361,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -386,8 +387,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -398,9 +399,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -425,8 +426,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -437,9 +438,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -464,8 +465,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -476,9 +477,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -504,8 +505,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -516,9 +517,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -545,8 +546,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -557,9 +558,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -587,8 +588,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -599,9 +600,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -630,8 +631,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -642,9 +643,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -674,8 +675,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -686,9 +687,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -719,8 +720,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -731,9 +732,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -765,8 +766,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -777,9 +778,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -820,8 +821,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -832,9 +833,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -875,8 +876,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -887,9 +888,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -931,8 +932,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -943,9 +944,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -988,8 +989,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1000,9 +1001,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1029,8 +1030,8 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, stub.UniqueError(37)),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, stub.UniqueError(37)),
call("fatalf", stub.ExpectArgs{"cannot open intermediate root: %v", []any{stub.UniqueError(37)}}, nil, nil),
},
}, nil},
@@ -1047,8 +1048,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1059,9 +1060,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1088,8 +1089,8 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, stub.UniqueError(35)),
call("fatalf", stub.ExpectArgs{"cannot enter sysroot: %v", []any{stub.UniqueError(35)}}, nil, nil),
},
@@ -1107,8 +1108,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1119,9 +1120,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1148,8 +1149,8 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, stub.UniqueError(33)),
call("fatalf", stub.ExpectArgs{"cannot pivot into sysroot: %v", []any{stub.UniqueError(33)}}, nil, nil),
@@ -1168,8 +1169,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1180,9 +1181,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1209,11 +1210,11 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, stub.UniqueError(31)),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, stub.UniqueError(31)),
call("fatalf", stub.ExpectArgs{"cannot re-enter intermediate root: %v", []any{stub.UniqueError(31)}}, nil, nil),
},
}, nil},
@@ -1230,8 +1231,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1242,9 +1243,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1271,11 +1272,11 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, stub.UniqueError(29)),
call("fatalf", stub.ExpectArgs{"cannot unmount intermediate root: %v", []any{stub.UniqueError(29)}}, nil, nil),
},
@@ -1293,8 +1294,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1305,9 +1306,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1334,11 +1335,11 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, stub.UniqueError(27)),
call("fatalf", stub.ExpectArgs{"cannot enter root: %v", []any{stub.UniqueError(27)}}, nil, nil),
@@ -1357,8 +1358,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1369,9 +1370,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1398,14 +1399,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, stub.UniqueError(25)),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, stub.UniqueError(25)),
call("fatalf", stub.ExpectArgs{"cannot close intermediate root: %v", []any{stub.UniqueError(25)}}, nil, nil),
},
}, nil},
@@ -1422,8 +1423,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1434,9 +1435,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1463,14 +1464,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, stub.UniqueError(23)),
call("fatalf", stub.ExpectArgs{"cannot clear the ambient capability set: %v", []any{stub.UniqueError(23)}}, nil, nil),
},
@@ -1488,8 +1489,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1500,9 +1501,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1529,14 +1530,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -1562,8 +1563,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1574,9 +1575,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1603,14 +1604,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -1669,8 +1670,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1681,9 +1682,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1710,14 +1711,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -1777,8 +1778,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1789,9 +1790,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1818,14 +1819,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -1888,7 +1889,7 @@ func TestInitEntrypoint(t *testing.T) {
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
Uid: 1 << 24,
- Gid: 1 << 47,
+ Gid: 1 << 23,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -1900,7 +1901,7 @@ func TestInitEntrypoint(t *testing.T) {
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("16777216 1971 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("140737488355328 127 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("8388608 127 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -1927,14 +1928,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -2002,7 +2003,7 @@ func TestInitEntrypoint(t *testing.T) {
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Nanosecond,
Uid: 1 << 24,
- Gid: 1 << 47,
+ Gid: 1 << 23,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -2014,7 +2015,7 @@ func TestInitEntrypoint(t *testing.T) {
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("16777216 1971 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("140737488355328 127 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("8388608 127 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -2041,14 +2042,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -2100,7 +2101,7 @@ func TestInitEntrypoint(t *testing.T) {
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Nanosecond,
Uid: 1 << 24,
- Gid: 1 << 47,
+ Gid: 1 << 23,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -2112,7 +2113,7 @@ func TestInitEntrypoint(t *testing.T) {
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("16777216 1971 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("140737488355328 127 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("8388608 127 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -2139,14 +2140,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -2198,7 +2199,7 @@ func TestInitEntrypoint(t *testing.T) {
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Nanosecond,
Uid: 1 << 24,
- Gid: 1 << 47,
+ Gid: 1 << 23,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -2210,7 +2211,7 @@ func TestInitEntrypoint(t *testing.T) {
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("16777216 1971 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("140737488355328 127 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("8388608 127 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -2237,14 +2238,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -2289,7 +2290,7 @@ func TestInitEntrypoint(t *testing.T) {
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Nanosecond,
Uid: 1 << 24,
- Gid: 1 << 47,
+ Gid: 1 << 23,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -2301,7 +2302,7 @@ func TestInitEntrypoint(t *testing.T) {
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("16777216 1971 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("140737488355328 127 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("8388608 127 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -2328,14 +2329,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -2364,7 +2365,7 @@ func TestInitEntrypoint(t *testing.T) {
call("wait4", stub.ExpectArgs{-1, syscall.WaitStatus(0xfade01ce), 0, nil}, 0xbad, nil),
// this terminates the goroutine at the call, preventing it from leaking while preserving behaviour
- call("wait4", stub.ExpectArgs{-1, nil, 0, nil, 0xdeadbeef}, 0, syscall.ECHILD),
+ call("wait4", stub.ExpectArgs{-1, nil, 0, nil, stub.PanicExit}, 0, syscall.ECHILD),
}}},
}, nil},
@@ -2382,7 +2383,7 @@ func TestInitEntrypoint(t *testing.T) {
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
Uid: 1 << 24,
- Gid: 1 << 47,
+ Gid: 1 << 13,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -2394,7 +2395,7 @@ func TestInitEntrypoint(t *testing.T) {
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("16777216 1971 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("140737488355328 127 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("8192 127 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -2421,14 +2422,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -2482,7 +2483,7 @@ func TestInitEntrypoint(t *testing.T) {
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
Uid: 1 << 24,
- Gid: 1 << 47,
+ Gid: 1 << 23,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -2494,7 +2495,7 @@ func TestInitEntrypoint(t *testing.T) {
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("16777216 1971 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("140737488355328 127 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("8388608 127 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -2521,14 +2522,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),
@@ -2617,8 +2618,8 @@ func TestInitEntrypoint(t *testing.T) {
Args: []string{"zsh", "-c", "exec vim"},
ForwardCancel: true,
AdoptWaitDelay: 5 * time.Second,
- Uid: 1 << 32,
- Gid: 1 << 31,
+ Uid: 1 << 16,
+ Gid: 1 << 15,
Hostname: "hakurei-check",
Ops: new(Ops).Bind(check.MustAbs("/"), check.MustAbs("/"), std.BindDevice).Proc(check.MustAbs("/proc/")),
SeccompRules: make([]std.NativeRule, 0),
@@ -2629,9 +2630,9 @@ func TestInitEntrypoint(t *testing.T) {
call("swapVerbose", stub.ExpectArgs{true}, false, nil),
call("verbose", stub.ExpectArgs{[]any{"received setup parameters"}}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(1)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("4294967296 1000 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/uid_map", []byte("65536 1000 1\n"), os.FileMode(0)}, nil, nil),
call("writeFile", stub.ExpectArgs{"/proc/self/setgroups", []byte("deny\n"), os.FileMode(0)}, nil, nil),
- call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("2147483648 100 1\n"), os.FileMode(0)}, nil, nil),
+ call("writeFile", stub.ExpectArgs{"/proc/self/gid_map", []byte("32768 100 1\n"), os.FileMode(0)}, nil, nil),
call("setDumpable", stub.ExpectArgs{uintptr(0)}, nil, nil),
call("umask", stub.ExpectArgs{0}, 022, nil),
call("sethostname", stub.ExpectArgs{[]byte("hakurei-check")}, nil, nil),
@@ -2658,14 +2659,14 @@ func TestInitEntrypoint(t *testing.T) {
/* end apply */
call("mount", stub.ExpectArgs{"host", "host", "", uintptr(0x4c000), ""}, nil, nil),
call("unmount", stub.ExpectArgs{"host", 2}, nil, nil),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, syscall.EINTR),
- call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, 1<<35, nil),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, syscall.EINTR),
+ call("open", stub.ExpectArgs{"/", syscall.O_DIRECTORY | syscall.O_RDONLY, uint32(0)}, math.MaxInt, nil),
call("chdir", stub.ExpectArgs{"/sysroot"}, nil, nil),
call("pivotRoot", stub.ExpectArgs{".", "."}, nil, nil),
- call("fchdir", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("fchdir", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("unmount", stub.ExpectArgs{".", 2}, nil, nil),
call("chdir", stub.ExpectArgs{"/"}, nil, nil),
- call("close", stub.ExpectArgs{1 << 35}, nil, nil),
+ call("close", stub.ExpectArgs{math.MaxInt}, nil, nil),
call("capAmbientClearAll", stub.ExpectArgs{}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x0)}, nil, nil),
call("capBoundingSetDrop", stub.ExpectArgs{uintptr(0x1)}, nil, nil),