diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-17 17:54:28 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-17 18:17:55 +0900 |
| commit | b1e1d5627e6532ec719c761846d7f38fe93fcadd (patch) | |
| tree | 2a308de9ee6a53b536ad00877158dc959e9cdea4 /internal/system/xhost.go | |
| parent | 3ae2ab652e9cd1d6250dbde8ae0f9b9fe90afc72 (diff) | |
system: wrap console output functions
This eliminates all fmsg imports from internal/system.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/system/xhost.go')
| -rw-r--r-- | internal/system/xhost.go | 15 |
1 files changed, 7 insertions, 8 deletions
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 } } |
