diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-16 17:26:09 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-16 18:51:53 +0900 |
| commit | e599b5583dd821ed26bdfc01f7f67d4a317b9843 (patch) | |
| tree | b444a3dc964814360e6779bc10b30f2e599b537c /internal/app/shim/manager.go | |
| parent | 33a4ab11c226c736c0d8b2644fbbe27a5ca045e9 (diff) | |
fmsg: implement suspend in writer
This removes the requirement to call fmsg.Exit on every exit path, and enables direct use of the "log" package. However, fmsg.BeforeExit is still encouraged when possible to catch exit on suspended output.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/shim/manager.go')
| -rw-r--r-- | internal/app/shim/manager.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/app/shim/manager.go b/internal/app/shim/manager.go index 106e4865..c4605635 100644 --- a/internal/app/shim/manager.go +++ b/internal/app/shim/manager.go @@ -4,6 +4,7 @@ import ( "context" "encoding/gob" "errors" + "log" "os" "os/exec" "strconv" @@ -54,8 +55,7 @@ func (s *Shim) Start( // prepare user switcher invocation var fsu string if p, ok := internal.Path(internal.Fsu); !ok { - fmsg.Fatal("invalid fsu path, this copy of fortify is not compiled correctly") - panic("unreachable") + log.Fatal("invalid fsu path, this copy of fortify is not compiled correctly") } else { fsu = p } @@ -75,7 +75,7 @@ func (s *Shim) Start( // format fsu supplementary groups if len(supp) > 0 { - fmsg.VPrintf("attaching supplementary group ids %s", supp) + fmsg.Verbosef("attaching supplementary group ids %s", supp) s.cmd.Env = append(s.cmd.Env, "FORTIFY_GROUPS="+strings.Join(supp, " ")) } s.cmd.Stdin, s.cmd.Stdout, s.cmd.Stderr = os.Stdin, os.Stdout, os.Stderr @@ -87,7 +87,7 @@ func (s *Shim) Start( s.sync = &fd } - fmsg.VPrintln("starting shim via fsu:", s.cmd) + fmsg.Verbose("starting shim via fsu:", s.cmd) // withhold messages to stderr fmsg.Suspend() if err := s.cmd.Start(); err != nil { |
