aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/share.runtime.go
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-10-11 02:01:03 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-10-11 02:01:03 +0900
commit6220f7e197f01846f5e4e3090acf9251f3ae6ade (patch)
treeb6282fefd49f321ca341c61019b144b2ea4260e5 /internal/app/share.runtime.go
parentb86fa6b4c91a2bf331ae4a50a5aa14b668efc4e6 (diff)
app: migrate to new shim implementation
Both machinectl and sudo launch methods launch shim as shim is now responsible for setting up the sandbox. Various app structures are adapted to accommodate bwrap configuration and mediated wayland access. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/app/share.runtime.go')
-rw-r--r--internal/app/share.runtime.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/app/share.runtime.go b/internal/app/share.runtime.go
index b015d45c..c25a89bc 100644
--- a/internal/app/share.runtime.go
+++ b/internal/app/share.runtime.go
@@ -1,6 +1,7 @@
package app
import (
+ "os"
"path"
"git.ophivana.moe/cat/fortify/acl"
@@ -11,10 +12,17 @@ const (
xdgRuntimeDir = "XDG_RUNTIME_DIR"
xdgSessionClass = "XDG_SESSION_CLASS"
xdgSessionType = "XDG_SESSION_TYPE"
+
+ shell = "SHELL"
)
// shareRuntime queues actions for sharing/ensuring the runtime and share directories
func (seal *appSeal) shareRuntime() {
+ // look up shell
+ if s, ok := os.LookupEnv(shell); ok {
+ seal.appendEnv(shell, s)
+ }
+
// ensure RunDir (e.g. `/run/user/%d/fortify`)
seal.sys.ensure(seal.RunDirPath, 0700)
seal.sys.updatePermTag(state.EnableLength, seal.RunDirPath, acl.Execute)