aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/system.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/system.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/system.go')
-rw-r--r--internal/app/system.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/internal/app/system.go b/internal/app/system.go
index aa62cfb0..b318b3a6 100644
--- a/internal/app/system.go
+++ b/internal/app/system.go
@@ -9,6 +9,7 @@ import (
"git.ophivana.moe/cat/fortify/acl"
"git.ophivana.moe/cat/fortify/dbus"
+ "git.ophivana.moe/cat/fortify/helper/bwrap"
"git.ophivana.moe/cat/fortify/internal"
"git.ophivana.moe/cat/fortify/internal/state"
"git.ophivana.moe/cat/fortify/internal/verbose"
@@ -19,6 +20,12 @@ import (
type appSeal struct {
// application unique identifier
id *appID
+ // bwrap config
+ bwrap *bwrap.Config
+ // wayland socket path if mediated wayland is enabled
+ wl string
+ // wait for wayland client to exit if mediated wayland is enabled
+ wlDone chan struct{}
// freedesktop application ID
fid string
@@ -187,7 +194,7 @@ func (tx *appSealTx) commit() error {
}
tx.complete = true
- txp := &appSealTx{}
+ txp := &appSealTx{User: tx.User}
defer func() {
// rollback partial commit
if txp != nil {
@@ -371,6 +378,8 @@ func (seal *appSeal) shareAll(bus [2]*dbus.Config) error {
seal.shared = true
seal.shareRuntime()
+ targetRuntime := seal.shareRuntimeChild()
+ verbose.Printf("child runtime data dir '%s' configured\n", targetRuntime)
if err := seal.shareDisplay(); err != nil {
return err
}
@@ -393,11 +402,5 @@ func (seal *appSeal) shareAll(bus [2]*dbus.Config) error {
verbose.Println("message bus proxy final args:", seal.sys.dbus)
}
- // workaround for launch method sudo
- if seal.launchOption == LaunchMethodSudo {
- targetRuntime := seal.shareRuntimeChild()
- verbose.Printf("child runtime data dir '%s' configured\n", targetRuntime)
- }
-
return nil
}