From b86fa6b4c91a2bf331ae4a50a5aa14b668efc4e6 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Fri, 11 Oct 2024 01:55:33 +0900 Subject: shim: new shim implementation This implementation of shim accepts configuration as a gob stream over a unix socket, with support for mediating access to wayland via WAYLAND_SOCKET fd. All configuration is now included in the payload, and child is started inside bwrap configured with supplied bwrap.Config. Signed-off-by: Ophestra Umiker --- internal/shim/payload.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 internal/shim/payload.go (limited to 'internal/shim/payload.go') diff --git a/internal/shim/payload.go b/internal/shim/payload.go new file mode 100644 index 00000000..6202bfe7 --- /dev/null +++ b/internal/shim/payload.go @@ -0,0 +1,23 @@ +package shim + +import ( + "git.ophivana.moe/cat/fortify/helper/bwrap" +) + +const EnvShim = "FORTIFY_SHIM" + +type Payload struct { + // child full argv + Argv []string + // env variables passed through to bwrap + Env []string + // bwrap, target full exec path + Exec [2]string + // bwrap config, nil for permissive + Bwrap *bwrap.Config + // whether to pas wayland fd + WL bool + + // verbosity pass through + Verbose bool +} -- cgit v1.3.1