From e599b5583dd821ed26bdfc01f7f67d4a317b9843 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 16 Feb 2025 17:26:09 +0900 Subject: 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 --- fst/sandbox.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fst') diff --git a/fst/sandbox.go b/fst/sandbox.go index 0c3918a9..a6b1eb56 100644 --- a/fst/sandbox.go +++ b/fst/sandbox.go @@ -53,7 +53,7 @@ func (s *SandboxConfig) Bwrap(os linux.System) (*bwrap.Config, error) { } if s.Syscall == nil { - fmsg.VPrintln("syscall filter not configured, PROCEED WITH CAUTION") + fmsg.Verbose("syscall filter not configured, PROCEED WITH CAUTION") } var uid int @@ -121,11 +121,11 @@ func (s *SandboxConfig) Bwrap(os linux.System) (*bwrap.Config, error) { // get parent dir of socket dir := path.Dir(pair[1]) if dir == "." || dir == "/" { - fmsg.VPrintf("dbus socket %q is in an unusual location", pair[1]) + fmsg.Verbosef("dbus socket %q is in an unusual location", pair[1]) } hidePaths = append(hidePaths, dir) } else { - fmsg.VPrintf("dbus socket %q is not absolute", pair[1]) + fmsg.Verbosef("dbus socket %q is not absolute", pair[1]) } } } @@ -169,7 +169,7 @@ func (s *SandboxConfig) Bwrap(os linux.System) (*bwrap.Config, error) { return nil, err } else if ok { hidePathMatch[i] = true - fmsg.VPrintf("hiding paths from %q", c.Src) + fmsg.Verbosef("hiding paths from %q", c.Src) } } @@ -221,7 +221,7 @@ func evalSymlinks(os linux.System, v *string) error { if !errors.Is(err, fs.ErrNotExist) { return err } - fmsg.VPrintf("path %q does not yet exist", *v) + fmsg.Verbosef("path %q does not yet exist", *v) } else { *v = p } -- cgit v1.3.1