MXS-1628: Respond with correct error to malformed packets

If the client sent a malformed authentication response packet, MaxScale
would interpret that as failed authentication.
This commit is contained in:
Markus Mäkelä
2018-05-10 12:45:43 +03:00
parent a544239540
commit 7d784001df
3 changed files with 28 additions and 9 deletions

View File

@ -1132,6 +1132,10 @@ mysql_client_auth_error_handling(DCB *dcb, int auth_val, int packet_number)
modutil_send_mysql_err_packet(dcb, packet_number, 0, 1045, "28000", fail_str);
break;
case MXS_AUTH_BAD_HANDSHAKE:
modutil_send_mysql_err_packet(dcb, packet_number, 0, 1045, "08S01", "Bad handshake");
break;
default:
MXS_DEBUG("%lu [gw_read_client_event] authentication failed. fd %d, "
"state unrecognized.", pthread_self(), dcb->fd);