diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-11 14:29:38 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-11 14:32:35 +0900 |
| commit | f5a597c4061b18b53e3124107c0e1434a98aedc9 (patch) | |
| tree | d339acafed909f5ec30bc6344d7c76322a0b9bd1 /internal | |
| parent | 8874aaf81b6d8028bd4dc3d4a1f09bf16b349085 (diff) | |
hst: rename /.hakurei constant
This provides disambiguation from fhs.AbsTmp.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/app/app_test.go | 14 | ||||
| -rw-r--r-- | internal/app/spcontainer.go | 2 | ||||
| -rw-r--r-- | internal/app/spcontainer_test.go | 4 | ||||
| -rw-r--r-- | internal/app/sppulse.go | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/internal/app/app_test.go b/internal/app/app_test.go index bfa42eb6..8fbe0113 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -98,7 +98,7 @@ func TestApp(t *testing.T) { Ops: new(container.Ops). Root(m("/"), bits.BindWritable). Proc(m("/proc/")). - Tmpfs(hst.AbsTmp, 4096, 0755). + Tmpfs(hst.AbsPrivateTmp, 4096, 0755). DevWritable(m("/dev/"), true). Tmpfs(m("/dev/shm"), 0, 01777). Bind(m("/dev/kvm"), m("/dev/kvm"), bits.BindWritable|bits.BindDevice|bits.BindOptional). @@ -252,7 +252,7 @@ func TestApp(t *testing.T) { "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/65534/bus", "DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket", "HOME=/home/chronos", - "PULSE_COOKIE=" + hst.Tmp + "/pulse-cookie", + "PULSE_COOKIE=" + hst.PrivateTmp + "/pulse-cookie", "PULSE_SERVER=unix:/run/user/65534/pulse/native", "SHELL=/run/current-system/sw/bin/zsh", "TERM=xterm-256color", @@ -265,7 +265,7 @@ func TestApp(t *testing.T) { Ops: new(container.Ops). Root(m("/"), bits.BindWritable). Proc(m("/proc/")). - Tmpfs(hst.AbsTmp, 4096, 0755). + Tmpfs(hst.AbsPrivateTmp, 4096, 0755). DevWritable(m("/dev/"), true). Tmpfs(m("/dev/shm"), 0, 01777). Bind(m("/dev/dri"), m("/dev/dri"), bits.BindWritable|bits.BindDevice|bits.BindOptional). @@ -282,7 +282,7 @@ func TestApp(t *testing.T) { Place(m("/etc/group"), []byte("hakurei:x:65534:\n")). Bind(m("/tmp/hakurei.0/ebf083d1b175911782d413369b64ce7c/wayland"), m("/run/user/65534/wayland-0"), 0). Bind(m("/run/user/1971/hakurei/ebf083d1b175911782d413369b64ce7c/pulse"), m("/run/user/65534/pulse/native"), 0). - Place(m(hst.Tmp+"/pulse-cookie"), bytes.Repeat([]byte{0}, pulseCookieSizeMax)). + Place(m(hst.PrivateTmp+"/pulse-cookie"), bytes.Repeat([]byte{0}, pulseCookieSizeMax)). Bind(m("/tmp/hakurei.0/ebf083d1b175911782d413369b64ce7c/bus"), m("/run/user/65534/bus"), 0). Bind(m("/tmp/hakurei.0/ebf083d1b175911782d413369b64ce7c/system_bus_socket"), m("/run/dbus/system_bus_socket"), 0). Remount(m("/"), syscall.MS_RDONLY), @@ -396,7 +396,7 @@ func TestApp(t *testing.T) { "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1971/bus", "DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket", "HOME=/var/lib/persist/module/hakurei/0/1", - "PULSE_COOKIE=" + hst.Tmp + "/pulse-cookie", + "PULSE_COOKIE=" + hst.PrivateTmp + "/pulse-cookie", "PULSE_SERVER=unix:/run/user/1971/pulse/native", "SHELL=/run/current-system/sw/bin/zsh", "TERM=xterm-256color", @@ -408,7 +408,7 @@ func TestApp(t *testing.T) { }, Ops: new(container.Ops). Proc(m("/proc/")). - Tmpfs(hst.AbsTmp, 4096, 0755). + Tmpfs(hst.AbsPrivateTmp, 4096, 0755). DevWritable(m("/dev/"), true). Tmpfs(m("/dev/shm"), 0, 01777). Bind(m("/bin"), m("/bin"), 0). @@ -432,7 +432,7 @@ func TestApp(t *testing.T) { Place(m("/etc/group"), []byte("hakurei:x:100:\n")). Bind(m("/run/user/1971/wayland-0"), m("/run/user/1971/wayland-0"), 0). Bind(m("/run/user/1971/hakurei/8e2c76b066dabe574cf073bdb46eb5c1/pulse"), m("/run/user/1971/pulse/native"), 0). - Place(m(hst.Tmp+"/pulse-cookie"), bytes.Repeat([]byte{0}, pulseCookieSizeMax)). + Place(m(hst.PrivateTmp+"/pulse-cookie"), bytes.Repeat([]byte{0}, pulseCookieSizeMax)). Bind(m("/tmp/hakurei.0/8e2c76b066dabe574cf073bdb46eb5c1/bus"), m("/run/user/1971/bus"), 0). Bind(m("/tmp/hakurei.0/8e2c76b066dabe574cf073bdb46eb5c1/system_bus_socket"), m("/run/dbus/system_bus_socket"), 0). Remount(m("/"), syscall.MS_RDONLY), diff --git a/internal/app/spcontainer.go b/internal/app/spcontainer.go index 62fffc8a..62c4f4f7 100644 --- a/internal/app/spcontainer.go +++ b/internal/app/spcontainer.go @@ -105,7 +105,7 @@ func (s *spParamsOp) toContainer(state *outcomeStateParams) error { // early mount points state.params. Proc(fhs.AbsProc). - Tmpfs(hst.AbsTmp, 1<<12, 0755) + Tmpfs(hst.AbsPrivateTmp, 1<<12, 0755) if !state.Container.Device { state.params.DevWritable(fhs.AbsDev, true) } else { diff --git a/internal/app/spcontainer_test.go b/internal/app/spcontainer_test.go index 653fba13..bcb1792f 100644 --- a/internal/app/spcontainer_test.go +++ b/internal/app/spcontainer_test.go @@ -69,7 +69,7 @@ func TestSpParamsOp(t *testing.T) { Gid: 100, Ops: new(container.Ops). Root(m("/var/lib/hakurei/base/org.debian"), bits.BindWritable). - Proc(fhs.AbsProc).Tmpfs(hst.AbsTmp, 1<<12, 0755). + Proc(fhs.AbsProc).Tmpfs(hst.AbsPrivateTmp, 1<<12, 0755). DevWritable(fhs.AbsDev, true). Tmpfs(fhs.AbsDev.Append("shm"), 0, 01777), }, func(t *testing.T, state *outcomeStateParams) { @@ -114,7 +114,7 @@ func TestSpParamsOp(t *testing.T) { Gid: 100, Ops: new(container.Ops). Root(m("/var/lib/hakurei/base/org.debian"), bits.BindWritable). - Proc(fhs.AbsProc).Tmpfs(hst.AbsTmp, 1<<12, 0755). + Proc(fhs.AbsProc).Tmpfs(hst.AbsPrivateTmp, 1<<12, 0755). Bind(fhs.AbsDev, fhs.AbsDev, bits.BindWritable|bits.BindDevice). Tmpfs(fhs.AbsDev.Append("shm"), 0, 01777), }, func(t *testing.T, state *outcomeStateParams) { diff --git a/internal/app/sppulse.go b/internal/app/sppulse.go index 8a2e753c..a9ef6ee2 100644 --- a/internal/app/sppulse.go +++ b/internal/app/sppulse.go @@ -160,7 +160,7 @@ func (s *spPulseOp) toContainer(state *outcomeStateParams) error { state.env["PULSE_SERVER"] = "unix:" + innerPulseSocket.String() if s.Cookie != nil { - innerDst := hst.AbsTmp.Append("/pulse-cookie") + innerDst := hst.AbsPrivateTmp.Append("/pulse-cookie") state.env["PULSE_COOKIE"] = innerDst.String() state.params.Place(innerDst, s.Cookie[:]) } |
