From b1e1d5627e6532ec719c761846d7f38fe93fcadd Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 17 Feb 2025 17:54:28 +0900 Subject: system: wrap console output functions This eliminates all fmsg imports from internal/system. Signed-off-by: Ophestra --- internal/system/xhost.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'internal/system/xhost.go') diff --git a/internal/system/xhost.go b/internal/system/xhost.go index 89e63db5..bbc0a914 100644 --- a/internal/system/xhost.go +++ b/internal/system/xhost.go @@ -3,7 +3,6 @@ package system import ( "fmt" - "git.gensokyo.uk/security/fortify/internal/fmsg" "git.gensokyo.uk/security/fortify/xcb" ) @@ -23,19 +22,19 @@ func (x XHost) Type() Enablement { return EX11 } -func (x XHost) apply(_ *I) error { - fmsg.Verbosef("inserting entry %s to X11", x) - return fmsg.WrapErrorSuffix(xcb.ChangeHosts(xcb.HostModeInsert, xcb.FamilyServerInterpreted, "localuser\x00"+string(x)), +func (x XHost) apply(sys *I) error { + sys.printf("inserting entry %s to X11", x) + return sys.wrapErrSuffix(xcb.ChangeHosts(xcb.HostModeInsert, xcb.FamilyServerInterpreted, "localuser\x00"+string(x)), fmt.Sprintf("cannot insert entry %s to X11:", x)) } -func (x XHost) revert(_ *I, ec *Criteria) error { +func (x XHost) revert(sys *I, ec *Criteria) error { if ec.hasType(x) { - fmsg.Verbosef("deleting entry %s from X11", x) - return fmsg.WrapErrorSuffix(xcb.ChangeHosts(xcb.HostModeDelete, xcb.FamilyServerInterpreted, "localuser\x00"+string(x)), + sys.printf("deleting entry %s from X11", x) + return sys.wrapErrSuffix(xcb.ChangeHosts(xcb.HostModeDelete, xcb.FamilyServerInterpreted, "localuser\x00"+string(x)), fmt.Sprintf("cannot delete entry %s from X11:", x)) } else { - fmsg.Verbosef("skipping entry %s in X11", x) + sys.printf("skipping entry %s in X11", x) return nil } } -- cgit v1.3.1