aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/seal.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-04-11 18:54:00 +0900
committerOphestra <cat@gensokyo.uk>2025-04-11 18:54:00 +0900
commit996790946092a9291eb21e297d1f0f04deab8b42 (patch)
treea3a8ff49deb5ed02ae282391720ce9613c2db7b3 /internal/app/seal.go
parentc806f43881223a85ad888f434e078dcc68de028d (diff)
sandbox: relative autoetc links
This allows nested containers to use autoetc, and increases compatibility with other implementations. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/seal.go')
-rw-r--r--internal/app/seal.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/app/seal.go b/internal/app/seal.go
index 4c8fbc78..3c93b34d 100644
--- a/internal/app/seal.go
+++ b/internal/app/seal.go
@@ -301,6 +301,18 @@ func (seal *outcome) finalise(ctx context.Context, sys sys.State, config *fst.Co
}
}
+ if !config.Confinement.Sandbox.AutoEtc {
+ if config.Confinement.Sandbox.Etc != "" {
+ seal.container.Bind(config.Confinement.Sandbox.Etc, "/etc", 0)
+ }
+ } else {
+ etcPath := config.Confinement.Sandbox.Etc
+ if etcPath == "" {
+ etcPath = "/etc"
+ }
+ seal.container.Etc(etcPath, seal.id.String())
+ }
+
// inner XDG_RUNTIME_DIR default formatting of `/run/user/%d` as mapped uid
innerRuntimeDir := path.Join("/run/user", mapuid.String())
seal.container.Tmpfs("/run/user", 1<<12, 0755)