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 /fst | |
| 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 'fst')
| -rw-r--r-- | fst/sandbox.go | 10 |
1 files changed, 5 insertions, 5 deletions
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 } |
