mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 00:37:00 +08:00
when reporting errors, mention the username of the relevant client
This commit is contained in:
10
src/log.c
10
src/log.c
@@ -118,7 +118,10 @@ void __attribute__ ((format(printf, 3, 4)))
|
||||
va_end(args);
|
||||
|
||||
if (ip) {
|
||||
syslog(priority, "worker: %s %s", ip, buf);
|
||||
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) {
|
||||
syslog(priority, "main: %s %s", ip, buf);
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user