From 6220f7e197f01846f5e4e3090acf9251f3ae6ade Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Fri, 11 Oct 2024 02:01:03 +0900 Subject: 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 --- internal/app/share.display.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/app/share.display.go') diff --git a/internal/app/share.display.go b/internal/app/share.display.go index 51ac54d3..01ae00a9 100644 --- a/internal/app/share.display.go +++ b/internal/app/share.display.go @@ -34,7 +34,7 @@ func (seal *appSeal) shareDisplay() error { if seal.et.Has(state.EnableWayland) { if wd, ok := os.LookupEnv(waylandDisplay); !ok { return (*ErrDisplayEnv)(wrapError(ErrWayland, "WAYLAND_DISPLAY is not set")) - } else { + } else if seal.wlDone == nil { // hardlink wayland socket wp := path.Join(seal.RuntimePath, wd) wpi := path.Join(seal.shareLocal, "wayland") @@ -43,6 +43,9 @@ func (seal *appSeal) shareDisplay() error { // ensure Wayland socket ACL (e.g. `/run/user/%d/wayland-%d`) seal.sys.updatePermTag(state.EnableWayland, wp, acl.Read, acl.Write, acl.Execute) + } else { + // set wayland socket path (e.g. `/run/user/%d/wayland-%d`) + seal.wl = path.Join(seal.RuntimePath, wd) } } -- cgit v1.3.1