summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2010-06-02 17:53:12 +0200
committerSergei Golubchik <sergii@pisem.net>2010-06-02 17:53:12 +0200
commitcdebfd3892af178dfeaddc5c0ddd284753905ba0 (patch)
tree01453593376bddb8104cf5d81b8831ca8ffbe433 /sql/sql_acl.cc
parentffc8f62b08982cc1f2fabf8b4b38bd124c115a97 (diff)
downloadmariadb-git-cdebfd3892af178dfeaddc5c0ddd284753905ba0.tar.gz
handle a case when a user connects with a password to a passwordless account
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 55e31b18e7f..db20782037e 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -8217,7 +8217,8 @@ static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio,
info->password_used = 1;
if (pkt_len == SCRAMBLE_LENGTH)
- return check_scramble(pkt, thd->scramble, mpvio->acl_user->salt) ?
+ return info->auth_string[0] == 0 ||
+ check_scramble(pkt, thd->scramble, mpvio->acl_user->salt) ?
CR_ERROR : CR_OK;
inc_host_errors(&mpvio->thd->net.vio->remote.sin_addr);
@@ -8268,7 +8269,8 @@ static int old_password_authenticate(MYSQL_PLUGIN_VIO *vio,
info->password_used = 1;
if (pkt_len == SCRAMBLE_LENGTH_323)
- return check_scramble_323(pkt, thd->scramble,
+ return info->auth_string[0] == 0 ||
+ check_scramble_323(pkt, thd->scramble,
(ulong *)mpvio->acl_user->salt) ? CR_ERROR : CR_OK;
inc_host_errors(&mpvio->thd->net.vio->remote.sin_addr);