mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-19 14:57:04 +00:00
Fix non-constant format string in calls to Printf-like functions
In a few places, we call Printf-like functions, but for the format we
use either non-format messages (which is not tidy, but okay), or
variable messages (which can be problematic if they contain %-format
directives).
The patch fixes the calls by either moving to Print-like functions, or
using `Printf("%s", message)` instead.
These were found by a combination of `go vet` (which complains about
"non-constant format string in call"), and manual inspection.
This commit is contained in:
@@ -97,8 +97,8 @@ func (l *Logger) Auth(netAddr net.Addr, user string, successful bool) {
|
||||
res = "failed"
|
||||
}
|
||||
msg := fmt.Sprintf("%s auth %s for %s\n", netAddr, res, user)
|
||||
l.printf(msg)
|
||||
authLog.Debugf(msg)
|
||||
l.printf("%s", msg)
|
||||
authLog.Debugf("%s", msg)
|
||||
}
|
||||
|
||||
// Rejected logs that we've rejected an email.
|
||||
|
||||
Reference in New Issue
Block a user