From 312c825b4e5d02d705227e7137710690a22deca4 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Thu, 14 Apr 2016 19:32:19 +0300 Subject: [PATCH] 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. --- server/modules/protocol/mysql_auth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/modules/protocol/mysql_auth.c b/server/modules/protocol/mysql_auth.c index 94b7f1d46..c09754827 100644 --- a/server/modules/protocol/mysql_auth.c +++ b/server/modules/protocol/mysql_auth.c @@ -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) {