From 3739b56504c7a268241c80b50461a19c4abe699c Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Sun, 13 Oct 2024 17:19:50 +0900 Subject: [PATCH] shim: update payload comment Generating permissive default no longer happens in shim. Signed-off-by: Ophestra Umiker --- internal/shim/main.go | 4 ++-- internal/shim/payload.go | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/shim/main.go b/internal/shim/main.go index 5b3303b..bb0b15b 100644 --- a/internal/shim/main.go +++ b/internal/shim/main.go @@ -18,7 +18,7 @@ import ( // everything beyond this point runs as target user // proceed with caution! -func shim(socket string) { +func doShim(socket string) { // re-exec if len(os.Args) > 0 && os.Args[0] != "fortify" && path.IsAbs(os.Args[0]) { if err := syscall.Exec(os.Args[0], []string{"fortify", "shim"}, os.Environ()); err != nil { @@ -163,7 +163,7 @@ func receiveWLfd(conn *net.UnixConn) (int, error) { func Try() { if args := flag.Args(); len(args) == 1 && args[0] == "shim" { if s, ok := os.LookupEnv(EnvShim); ok { - shim(s) + doShim(s) panic("unreachable") } } diff --git a/internal/shim/payload.go b/internal/shim/payload.go index 3919bb8..7248c86 100644 --- a/internal/shim/payload.go +++ b/internal/shim/payload.go @@ -1,8 +1,6 @@ package shim -import ( - "git.ophivana.moe/cat/fortify/helper/bwrap" -) +import "git.ophivana.moe/cat/fortify/helper/bwrap" const EnvShim = "FORTIFY_SHIM" @@ -11,7 +9,7 @@ type Payload struct { Argv []string // bwrap, target full exec path Exec [2]string - // bwrap config, nil for permissive + // bwrap config Bwrap *bwrap.Config // whether to pass wayland fd WL bool