Use RFC 3986 compliant addresses in log messages
When log messages are written with both address and port information, IPv6 addresses can cause confusion if the normal address:port formatting is used. The RFC 3986 suggests that all IPv6 addresses are expressed as a bracket enclosed address optionally followed by the port that is separate from the address by a colon. In practice, the "all interfaces" address and port number 3306 can be written in IPv4 numbers-and-dots notation as 0.0.0.0:3306 and in IPv6 notation as [::]:3306. Using the latter format in log messages keeps the output consistent with all types of addresses. The details of the standard can be found at the following addresses: https://www.ietf.org/rfc/rfc3986.txt https://www.rfc-editor.org/std/std66.txt
This commit is contained in:
@ -494,7 +494,7 @@ static bool check_server_permissions(SERVICE *service, SERVER* server,
|
||||
{
|
||||
int my_errno = mysql_errno(mysql);
|
||||
|
||||
MXS_ERROR("[%s] Failed to connect to server '%s' (%s:%d) when"
|
||||
MXS_ERROR("[%s] Failed to connect to server '%s' ([%s]:%d) when"
|
||||
" checking authentication user credentials and permissions: %d %s",
|
||||
service->name, server->unique_name, server->name, server->port,
|
||||
my_errno, mysql_error(mysql));
|
||||
|
@ -349,7 +349,7 @@ mysql_auth_authenticate(DCB *dcb)
|
||||
}
|
||||
else if (dcb->service->log_auth_warnings)
|
||||
{
|
||||
MXS_WARNING("%s: login attempt for user '%s'@%s:%d, authentication failed.",
|
||||
MXS_WARNING("%s: login attempt for user '%s'@[%s]:%d, authentication failed.",
|
||||
dcb->service->name, client_data->user, dcb->remote, dcb_get_port(dcb));
|
||||
|
||||
if (is_localhost_address(&dcb->ip) &&
|
||||
|
Reference in New Issue
Block a user