summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-06-11 10:09:29 +0200
committerSergei Golubchik <sergii@pisem.net>2014-06-11 10:09:29 +0200
commit1eaf2106e5ec14ec3626a67644ce5fcb927b8dce (patch)
treec59eef6d693cdfe25613b00431bbfeb0d44ea843 /sql/sql_acl.cc
parent805d302dec2b39e3d12f2636c3e64c245f8e325c (diff)
downloadmariadb-git-1eaf2106e5ec14ec3626a67644ce5fcb927b8dce.tar.gz
MDEV-6253 MySQL Users Break when Migrating from MySQL 5.1 to MariaDB 10.0.10
When plugin=mysql_native_password (or mysql_old_password) take the password from *either* password *or* authentication_string, whichever is set. This makes no sense, but alas, that's what MySQL-5.6 does.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 5f077c22168..5e8e0e7a4e8 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -877,7 +877,6 @@ static char *fix_plugin_ptr(char *name)
*/
static bool fix_user_plugin_ptr(ACL_USER *user)
{
- user->salt_len= 0;
if (my_strcasecmp(system_charset_info, user->plugin.str,
native_password_plugin_name.str) == 0)
user->plugin= native_password_plugin_name;
@@ -888,7 +887,8 @@ static bool fix_user_plugin_ptr(ACL_USER *user)
else
return true;
- set_user_salt(user, user->auth_string.str, user->auth_string.length);
+ if (user->auth_string.length)
+ set_user_salt(user, user->auth_string.str, user->auth_string.length);
return false;
}
@@ -1259,7 +1259,11 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
{
user.plugin.str= tmpstr;
user.plugin.length= strlen(user.plugin.str);
- if (user.auth_string.length)
+ user.auth_string.str=
+ safe_str(get_field(&acl_memroot, table->field[next_field++]));
+ user.auth_string.length= strlen(user.auth_string.str);
+
+ if (user.auth_string.length && password_len)
{
sql_print_warning("'user' entry '%s@%s' has both a password "
"and an authentication plugin specified. The "
@@ -1267,9 +1271,6 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables)
safe_str(user.user.str),
safe_str(user.host.hostname));
}
- user.auth_string.str=
- safe_str(get_field(&acl_memroot, table->field[next_field++]));
- user.auth_string.length= strlen(user.auth_string.str);
fix_user_plugin_ptr(&user);
}