aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--container/fhs/abs.go2
-rw-r--r--container/fhs/fhs.go2
-rw-r--r--internal/outcome/main_test.go8
-rw-r--r--internal/outcome/shim_test.go2
-rw-r--r--internal/outcome/spcontainer.go2
-rw-r--r--internal/outcome/spcontainer_test.go4
6 files changed, 12 insertions, 8 deletions
diff --git a/container/fhs/abs.go b/container/fhs/abs.go
index 9175c1fe..dfd3c04f 100644
--- a/container/fhs/abs.go
+++ b/container/fhs/abs.go
@@ -36,6 +36,8 @@ var (
// AbsDev is [Dev] as [check.Absolute].
AbsDev = unsafeAbs(Dev)
+ // AbsDevShm is [DevShm] as [check.Absolute].
+ AbsDevShm = unsafeAbs(DevShm)
// AbsProc is [Proc] as [check.Absolute].
AbsProc = unsafeAbs(Proc)
// AbsSys is [Sys] as [check.Absolute].
diff --git a/container/fhs/fhs.go b/container/fhs/fhs.go
index 6a3a3041..7e0d36c7 100644
--- a/container/fhs/fhs.go
+++ b/container/fhs/fhs.go
@@ -29,6 +29,8 @@ const (
// Dev points to the root directory for device nodes.
Dev = "/dev/"
+ // DevShm is the place for POSIX shared memory segments, as created via shm_open(3).
+ DevShm = "/dev/shm/"
// Proc points to a virtual kernel file system exposing the process list and other functionality.
Proc = "/proc/"
// ProcSys points to a hierarchy below /proc/ that exposes a number of kernel tunables.
diff --git a/internal/outcome/main_test.go b/internal/outcome/main_test.go
index ecc4ccc4..de2113f2 100644
--- a/internal/outcome/main_test.go
+++ b/internal/outcome/main_test.go
@@ -141,7 +141,7 @@ func TestOutcomeMain(t *testing.T) {
Proc(fhs.AbsProc).
Tmpfs(hst.AbsPrivateTmp, 1<<12, 0755).
Bind(fhs.AbsDev, fhs.AbsDev, std.BindWritable|std.BindDevice).
- Tmpfs(fhs.AbsDev.Append("shm"), 0, 01777).
+ Tmpfs(fhs.AbsDevShm, 0, 01777).
// spRuntimeOp
Tmpfs(fhs.AbsRunUser, 1<<12, 0755).
@@ -243,7 +243,7 @@ func TestOutcomeMain(t *testing.T) {
Proc(m("/proc/")).
Tmpfs(hst.AbsPrivateTmp, 4096, 0755).
DevWritable(m("/dev/"), true).
- Tmpfs(m("/dev/shm"), 0, 01777).
+ Tmpfs(m("/dev/shm/"), 0, 01777).
Tmpfs(m("/run/user/"), 4096, 0755).
Bind(m("/tmp/hakurei.0/runtime/0"), m("/run/user/65534"), std.BindWritable).
Bind(m("/tmp/hakurei.0/tmpdir/0"), m("/tmp/"), std.BindWritable).
@@ -412,7 +412,7 @@ func TestOutcomeMain(t *testing.T) {
Proc(m("/proc/")).
Tmpfs(hst.AbsPrivateTmp, 4096, 0755).
DevWritable(m("/dev/"), true).
- Tmpfs(m("/dev/shm"), 0, 01777).
+ Tmpfs(m("/dev/shm/"), 0, 01777).
Tmpfs(m("/run/user/"), 4096, 0755).
Bind(m("/tmp/hakurei.0/runtime/9"), m("/run/user/65534"), std.BindWritable).
Bind(m("/tmp/hakurei.0/tmpdir/9"), m("/tmp/"), std.BindWritable).
@@ -558,7 +558,7 @@ func TestOutcomeMain(t *testing.T) {
Proc(m("/proc/")).
Tmpfs(hst.AbsPrivateTmp, 4096, 0755).
DevWritable(m("/dev/"), true).
- Tmpfs(m("/dev/shm"), 0, 01777).
+ Tmpfs(m("/dev/shm/"), 0, 01777).
Tmpfs(m("/run/user/"), 4096, 0755).
Bind(m("/tmp/hakurei.0/runtime/1"), m("/run/user/1971"), std.BindWritable).
Bind(m("/tmp/hakurei.0/tmpdir/1"), m("/tmp/"), std.BindWritable).
diff --git a/internal/outcome/shim_test.go b/internal/outcome/shim_test.go
index c18e1f96..147607fa 100644
--- a/internal/outcome/shim_test.go
+++ b/internal/outcome/shim_test.go
@@ -66,7 +66,7 @@ func TestShimEntrypoint(t *testing.T) {
Proc(fhs.AbsProc).
Tmpfs(hst.AbsPrivateTmp, 1<<12, 0755).
Bind(fhs.AbsDev, fhs.AbsDev, std.BindWritable|std.BindDevice).
- Tmpfs(fhs.AbsDev.Append("shm"), 0, 01777).
+ Tmpfs(fhs.AbsDevShm, 0, 01777).
// spRuntimeOp
Tmpfs(fhs.AbsRunUser, 1<<12, 0755).
diff --git a/internal/outcome/spcontainer.go b/internal/outcome/spcontainer.go
index a6eed75b..738d3383 100644
--- a/internal/outcome/spcontainer.go
+++ b/internal/outcome/spcontainer.go
@@ -116,7 +116,7 @@ func (s *spParamsOp) toContainer(state *outcomeStateParams) error {
state.params.Bind(fhs.AbsDev, fhs.AbsDev, std.BindWritable|std.BindDevice)
}
// /dev is mounted readonly later on, this prevents /dev/shm from going readonly with it
- state.params.Tmpfs(fhs.AbsDev.Append("shm"), 0, 01777)
+ state.params.Tmpfs(fhs.AbsDevShm, 0, 01777)
return nil
}
diff --git a/internal/outcome/spcontainer_test.go b/internal/outcome/spcontainer_test.go
index 0334ac07..d6999b9d 100644
--- a/internal/outcome/spcontainer_test.go
+++ b/internal/outcome/spcontainer_test.go
@@ -72,7 +72,7 @@ func TestSpParamsOp(t *testing.T) {
Root(m("/var/lib/hakurei/base/org.debian"), std.BindWritable).
Proc(fhs.AbsProc).Tmpfs(hst.AbsPrivateTmp, 1<<12, 0755).
DevWritable(fhs.AbsDev, true).
- Tmpfs(fhs.AbsDev.Append("shm"), 0, 01777),
+ Tmpfs(fhs.AbsDevShm, 0, 01777),
}, paramsWantEnv(config, map[string]string{
"TERM": "xterm",
}, func(t *testing.T, state *outcomeStateParams) {
@@ -110,7 +110,7 @@ func TestSpParamsOp(t *testing.T) {
Root(m("/var/lib/hakurei/base/org.debian"), std.BindWritable).
Proc(fhs.AbsProc).Tmpfs(hst.AbsPrivateTmp, 1<<12, 0755).
Bind(fhs.AbsDev, fhs.AbsDev, std.BindWritable|std.BindDevice).
- Tmpfs(fhs.AbsDev.Append("shm"), 0, 01777),
+ Tmpfs(fhs.AbsDevShm, 0, 01777),
}, paramsWantEnv(config, map[string]string{
"TERM": "xterm",
}, func(t *testing.T, state *outcomeStateParams) {