diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-10-21 20:47:02 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-10-21 20:47:02 +0900 |
| commit | 42e0b168e3d75389dfb968aebf9f5629d64782f9 (patch) | |
| tree | e6b430205213c62bc06275c6d84e6037d40f5c3f /internal/system/acl.go | |
| parent | 380d1f45851b7dffb963c51da96a17ba41f3cfb8 (diff) | |
fmsg: produce all output through fmsg
The behaviour of print functions from package fmt is not thread safe. Functions provided by fmsg wrap around Logger methods. This makes prefix much cleaner and makes it easy to deal with future changes to logging.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/system/acl.go')
| -rw-r--r-- | internal/system/acl.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/system/acl.go b/internal/system/acl.go index e4bc9359..f8f1dc68 100644 --- a/internal/system/acl.go +++ b/internal/system/acl.go @@ -6,7 +6,6 @@ import ( "git.ophivana.moe/security/fortify/acl" "git.ophivana.moe/security/fortify/internal/fmsg" - "git.ophivana.moe/security/fortify/internal/verbose" ) // UpdatePerm appends an ephemeral acl update Op. @@ -33,18 +32,20 @@ func (a *ACL) Type() Enablement { } func (a *ACL) apply(sys *I) error { - verbose.Println("applying ACL", a, "uid:", sys.uid, "type:", TypeString(a.et), "path:", a.path) + fmsg.VPrintf("applying ACL %s uid: %d type: %s path: %q", + a, sys.uid, TypeString(a.et), a.path) return fmsg.WrapErrorSuffix(acl.UpdatePerm(a.path, sys.uid, a.perms...), fmt.Sprintf("cannot apply ACL entry to %q:", a.path)) } func (a *ACL) revert(sys *I, ec *Criteria) error { if ec.hasType(a) { - verbose.Println("stripping ACL", a, "uid:", sys.uid, "type:", TypeString(a.et), "path:", a.path) + fmsg.VPrintf("stripping ACL %s uid: %d type: %s path: %q", + a, sys.uid, TypeString(a.et), a.path) return fmsg.WrapErrorSuffix(acl.UpdatePerm(a.path, sys.uid), fmt.Sprintf("cannot strip ACL entry from %q:", a.path)) } else { - verbose.Println("skipping ACL", a, "uid:", sys.uid, "tag:", TypeString(a.et), "path:", a.path) + fmsg.VPrintln("skipping ACL", a, "uid:", sys.uid, "tag:", TypeString(a.et), "path:", a.path) return nil } } |
