summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-12-20 19:19:24 +0100
committerSergei Golubchik <sergii@pisem.net>2010-12-20 19:19:24 +0100
commit6c958d6e80f681c207f4298b754c8b18170d3224 (patch)
tree96b8f5ca4d1a282310ba916b698a2f9db6870e45 /sql/sql_acl.cc
parent970e67b5e3c459d0a6b8a0e4ce4a3bf602362fba (diff)
downloadmariadb-git-6c958d6e80f681c207f4298b754c8b18170d3224.tar.gz
bug#683112 Maria 5.2 incorrectly reports "(using password: NO)" even when password is specified
set thd->password appropriately also for cases when a user was not found.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 87e27d68b98..9b1d0df4251 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -6980,16 +6980,16 @@ struct MPVIO_EXT : public MYSQL_PLUGIN_VIO
a helper function to report an access denied error in all the proper places
*/
-static void login_failed_error(THD *thd, bool passwd_used)
+static void login_failed_error(THD *thd)
{
my_error(ER_ACCESS_DENIED_ERROR, MYF(0),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
- passwd_used ? ER(ER_YES) : ER(ER_NO));
+ thd->password ? ER(ER_YES) : ER(ER_NO));
general_log_print(thd, COM_CONNECT, ER(ER_ACCESS_DENIED_ERROR),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
- passwd_used ? ER(ER_YES) : ER(ER_NO));
+ thd->password ? ER(ER_YES) : ER(ER_NO));
status_var_increment(thd->status_var.access_denied_errors);
/*
Log access denied messages to the error log when log-warnings = 2
@@ -7001,7 +7001,7 @@ static void login_failed_error(THD *thd, bool passwd_used)
sql_print_warning(ER(ER_ACCESS_DENIED_ERROR),
thd->main_security_ctx.user,
thd->main_security_ctx.host_or_ip,
- passwd_used ? ER(ER_YES) : ER(ER_NO));
+ thd->password ? ER(ER_YES) : ER(ER_NO));
}
}
@@ -7266,7 +7266,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio, Security_context *sctx)
if (!mpvio->acl_user)
{
- login_failed_error(mpvio->thd, 0);
+ login_failed_error(mpvio->thd);
return 1;
}
@@ -7583,8 +7583,11 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
return packet_error;
}
+ thd->password= passwd_len > 0;
if (find_mpvio_user(mpvio, sctx))
+ {
return packet_error;
+ }
if (thd->client_capabilities & CLIENT_PLUGIN_AUTH)
{
@@ -8072,7 +8075,7 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
DBUG_ASSERT(mpvio.status == MPVIO_EXT::FAILURE);
if (!thd->is_error())
- login_failed_error(thd, thd->password);
+ login_failed_error(thd);
DBUG_RETURN(1);
}
@@ -8092,7 +8095,7 @@ bool acl_authenticate(THD *thd, uint connect_errors, uint com_change_user_pkt_le
*/
if (acl_check_ssl(thd, acl_user))
{
- login_failed_error(thd, thd->password);
+ login_failed_error(thd);
DBUG_RETURN(1);
}