From f2362c3359cfc7001bc65fb0d4f3994ce54792cd Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Thu, 16 Oct 2014 12:50:14 +0200 Subject: [PATCH] Auth error message fix for using password: YES,NO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Auth error message fix for using password: YES,NO This applies to a “not found user” trying to authenticate with or without password --- server/modules/protocol/mysql_common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/modules/protocol/mysql_common.c b/server/modules/protocol/mysql_common.c index a81c7e983..9e1469878 100644 --- a/server/modules/protocol/mysql_common.c +++ b/server/modules/protocol/mysql_common.c @@ -1236,6 +1236,12 @@ int gw_check_mysql_scramble_data(DCB *dcb, uint8_t *token, unsigned int token_le ret_val = gw_find_mysql_user_password_sha1(username, password, dcb); if (ret_val) { + /* if password was sent, fill stage1_hash with at least 1 byte in order + * to create rigth error message: (using password: YES|NO) + */ + if (token_len) + memcpy(stage1_hash, (char *)"_", 1); + return 1; }