Added client IP address to authentication error messages

Client authentication problems are easier to solve when the client IP is logged
in case a failed authentication attempt is made. This will also make it easier
to detect possible security problems.
This commit is contained in:
Markus Makela
2016-04-14 19:32:19 +03:00
parent a0d027a513
commit 312c825b4e

View File

@ -107,8 +107,8 @@ mysql_auth_authenticate(DCB *dcb, GWBUF **buffer)
}
else if (dcb->service->log_auth_warnings)
{
MXS_NOTICE("%s: login attempt for user '%s', authentication failed.",
dcb->service->name, client_data->user);
MXS_NOTICE("%s: login attempt for user '%s'@%s:%d, authentication failed.",
dcb->service->name, client_data->user, dcb->remote, ntohs(dcb->ipv4.sin_port));
if (dcb->ipv4.sin_addr.s_addr == 0x0100007F &&
!dcb->service->localhost_match_wildcard_host)
{