when reporting errors, mention the username of the relevant client

This commit is contained in:
Nikos Mavrogiannopoulos
2014-10-31 11:03:12 +01:00
parent c9c9c9c32d
commit 12fb56a3b6

View File

@@ -118,7 +118,10 @@ void __attribute__ ((format(printf, 3, 4)))
va_end(args);
if (ip) {
if (ws->username[0] == 0)
syslog(priority, "worker: %s %s", ip, buf);
else
syslog(priority, "worker: %s[%s] %s", ip, ws->username, buf);
} else {
syslog(priority, "worker: [unknown] %s", buf);
}
@@ -161,7 +164,10 @@ void __attribute__ ((format(printf, 4, 5)))
va_end(args);
if (ip) {
if (proc->username[0] == 0)
syslog(priority, "main: %s %s", ip, buf);
else
syslog(priority, "main: %s[%s] %s", ip, proc->username, buf);
} else {
syslog(priority, "main: %s", buf);
}