aboutsummaryrefslogtreecommitdiffhomepage
path: root/hst
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-11 14:29:38 +0900
committerOphestra <cat@gensokyo.uk>2025-10-11 14:32:35 +0900
commitf5a597c4061b18b53e3124107c0e1434a98aedc9 (patch)
treed339acafed909f5ec30bc6344d7c76322a0b9bd1 /hst
parent8874aaf81b6d8028bd4dc3d4a1f09bf16b349085 (diff)
hst: rename /.hakurei constant
This provides disambiguation from fhs.AbsTmp. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst')
-rw-r--r--hst/config.go6
-rw-r--r--hst/config_test.go4
-rw-r--r--hst/fsephemeral_test.go6
3 files changed, 9 insertions, 7 deletions
diff --git a/hst/config.go b/hst/config.go
index 9d0ef67a..08a23f07 100644
--- a/hst/config.go
+++ b/hst/config.go
@@ -8,9 +8,11 @@ import (
"hakurei.app/container/check"
)
-const Tmp = "/.hakurei"
+// PrivateTmp is a private writable path in a hakurei container.
+const PrivateTmp = "/.hakurei"
-var AbsTmp = check.MustAbs(Tmp)
+// AbsPrivateTmp is a [check.Absolute] representation of [PrivateTmp].
+var AbsPrivateTmp = check.MustAbs(PrivateTmp)
const (
// WaitDelayDefault is used when WaitDelay has its zero value.
diff --git a/hst/config_test.go b/hst/config_test.go
index eba2b793..211bd1c1 100644
--- a/hst/config_test.go
+++ b/hst/config_test.go
@@ -62,8 +62,8 @@ func TestExtraPermConfig(t *testing.T) {
{"nil path", &hst.ExtraPermConfig{Path: nil}, "<invalid>"},
{"r", &hst.ExtraPermConfig{Path: fhs.AbsRoot, Read: true}, "r--:/"},
{"r+", &hst.ExtraPermConfig{Ensure: true, Path: fhs.AbsRoot, Read: true}, "r--+:/"},
- {"w", &hst.ExtraPermConfig{Path: hst.AbsTmp, Write: true}, "-w-:/.hakurei"},
- {"w+", &hst.ExtraPermConfig{Ensure: true, Path: hst.AbsTmp, Write: true}, "-w-+:/.hakurei"},
+ {"w", &hst.ExtraPermConfig{Path: hst.AbsPrivateTmp, Write: true}, "-w-:/.hakurei"},
+ {"w+", &hst.ExtraPermConfig{Ensure: true, Path: hst.AbsPrivateTmp, Write: true}, "-w-+:/.hakurei"},
{"x", &hst.ExtraPermConfig{Path: fhs.AbsRunUser, Execute: true}, "--x:/run/user/"},
{"x+", &hst.ExtraPermConfig{Ensure: true, Path: fhs.AbsRunUser, Execute: true}, "--x+:/run/user/"},
{"rwx", &hst.ExtraPermConfig{Path: fhs.AbsTmp, Read: true, Write: true, Execute: true}, "rwx:/tmp/"},
diff --git a/hst/fsephemeral_test.go b/hst/fsephemeral_test.go
index ed8bbf46..4bda3165 100644
--- a/hst/fsephemeral_test.go
+++ b/hst/fsephemeral_test.go
@@ -36,15 +36,15 @@ func TestFSEphemeral(t *testing.T) {
"+ephemeral(-rwxr-xr-x):/run/nscd"},
{"negative size", &hst.FSEphemeral{
- Target: hst.AbsTmp,
+ Target: hst.AbsPrivateTmp,
Write: true,
Size: -1,
}, true, container.Ops{&container.MountTmpfsOp{
FSName: "ephemeral",
- Path: hst.AbsTmp,
+ Path: hst.AbsPrivateTmp,
Flags: syscall.MS_NOSUID | syscall.MS_NODEV,
Perm: 0755,
- }}, hst.AbsTmp, nil,
+ }}, hst.AbsPrivateTmp, nil,
"w+ephemeral(-rwxr-xr-x):/.hakurei"},
})
}