aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/outcome/outcome.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/outcome/outcome.go')
-rw-r--r--internal/outcome/outcome.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/internal/outcome/outcome.go b/internal/outcome/outcome.go
index 0fe0016e..19ca9c7b 100644
--- a/internal/outcome/outcome.go
+++ b/internal/outcome/outcome.go
@@ -6,6 +6,7 @@ import (
"errors"
"maps"
"strconv"
+ "time"
"hakurei.app/check"
"hakurei.app/container"
@@ -125,6 +126,14 @@ func newOutcomeState(k syscallDispatcher, msg message.Msg, id *hst.ID, config *h
s.Shim.WaitDelay = s.Container.WaitDelay
}
+ if s.Container.AdoptWaitDelay > 5*time.Second {
+ s.Shim.AdoptWaitDelay = 5 * time.Second
+ } else if s.Container.AdoptWaitDelay < 0 {
+ s.Shim.AdoptWaitDelay = -1
+ } else {
+ s.Shim.AdoptWaitDelay = s.Container.AdoptWaitDelay
+ }
+
if s.Container.Flags&hst.FMapRealUID != 0 {
s.Mapuid, s.Mapgid = k.getuid(), k.getgid()
} else {
@@ -240,8 +249,8 @@ func (state *outcomeStateSys) ensureRuntimeDir() {
state.useRuntimeDir = true
state.sys.
// ensure this dir in case XDG_RUNTIME_DIR is unset
- Ensure(state.sc.RuntimePath, 0700).UpdatePermType(system.User, state.sc.RuntimePath, acl.Execute).
- Ensure(state.sc.RunDirPath, 0700).UpdatePermType(system.User, state.sc.RunDirPath, acl.Execute)
+ Ensure(state.sc.RuntimePath, 0700, true).UpdatePermType(system.User, state.sc.RuntimePath, acl.Execute).
+ Ensure(state.sc.RunDirPath, 0700, true).UpdatePermType(system.User, state.sc.RunDirPath, acl.Execute)
}
// instance returns the pathname to a process-specific directory within TMPDIR.
@@ -252,7 +261,7 @@ func (state *outcomeStateSys) instance() *check.Absolute {
return state.sharePath
}
state.sharePath = state.instancePath()
- state.sys.Ephemeral(system.Process, state.sharePath, 0711)
+ state.sys.Ephemeral(system.Process, state.sharePath, 0711, false)
return state.sharePath
}
@@ -265,7 +274,7 @@ func (state *outcomeStateSys) runtime() *check.Absolute {
}
state.ensureRuntimeDir()
state.runtimeSharePath = state.runtimePath()
- state.sys.Ephemeral(system.Process, state.runtimeSharePath, 0700)
+ state.sys.Ephemeral(system.Process, state.runtimeSharePath, 0700, true)
state.sys.UpdatePerm(state.runtimeSharePath, acl.Execute)
return state.runtimeSharePath
}