diff options
author | unknown <hery.ramilison@oracle.com> | 2011-07-06 01:13:50 +0200 |
---|---|---|
committer | MySQL Release Engineering <mysql-re_ww@oracle.com> | 2011-07-06 01:13:50 +0200 |
commit | 7d605ec45f8e55e1775fd028931c459e6501d25a (patch) | |
tree | 31e14059cf5a1e5e8c1601a2488b98c4af1bfeb0 /sql/sql_acl.cc | |
parent | 8f73e64fff57fe4080cfc4d2816555b0d22b9e13 (diff) | |
parent | 8b1566aaaf93e6e885badd6500a07a0f70cc81f3 (diff) | |
download | mariadb-git-7d605ec45f8e55e1775fd028931c459e6501d25a.tar.gz |
Merge from mysql-5.5.14-release
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 89b9632b47e..f4d217c85ff 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -825,8 +825,6 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) char *password= get_field(&mem, table->field[2]); uint password_len= password ? strlen(password) : 0; - user.auth_string.str= password ? password : const_cast<char*>(""); - user.auth_string.length= password_len; set_user_salt(&user, password, password_len); if (set_user_plugin(&user, password_len)) @@ -915,7 +913,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) char *tmpstr= get_field(&mem, table->field[next_field++]); if (tmpstr) { - if (user.auth_string.length) + if (password_len) { sql_print_warning("'user' entry '%s@%s' has both a password " "and an authentication plugin specified. The " @@ -1483,8 +1481,8 @@ static void acl_insert_user(const char *user, const char *host, { acl_user.plugin= password_len == SCRAMBLED_PASSWORD_CHAR_LENGTH_323 ? old_password_plugin_name : native_password_plugin_name; - acl_user.auth_string.str= strmake_root(&mem, password, password_len); - acl_user.auth_string.length= password_len; + acl_user.auth_string.str= const_cast<char*>(""); + acl_user.auth_string.length= 0; } acl_user.access=privileges; @@ -8380,7 +8378,7 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length) old_password_plugin, otherwise MySQL will think that server and client plugins don't match. */ - if (mpvio->acl_user->auth_string.length == 0) + if (mpvio->acl_user->salt_len == 0) mpvio->acl_user_plugin= old_password_plugin_name; } } @@ -8767,7 +8765,7 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, old_password_plugin, otherwise MySQL will think that server and client plugins don't match. */ - if (mpvio->acl_user->auth_string.length == 0) + if (mpvio->acl_user->salt_len == 0) mpvio->acl_user_plugin= old_password_plugin_name; } } @@ -9555,7 +9553,7 @@ static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio, #endif if (pkt_len == 0) /* no password */ - DBUG_RETURN(info->auth_string[0] ? CR_ERROR : CR_OK); + DBUG_RETURN(mpvio->acl_user->salt_len != 0 ? CR_ERROR : CR_OK); info->password_used= PASSWORD_USED_YES; if (pkt_len == SCRAMBLE_LENGTH) @@ -9604,7 +9602,7 @@ static int old_password_authenticate(MYSQL_PLUGIN_VIO *vio, pkt_len= strnlen((char*)pkt, pkt_len); if (pkt_len == 0) /* no password */ - return info->auth_string[0] ? CR_ERROR : CR_OK; + return mpvio->acl_user->salt_len != 0 ? CR_ERROR : CR_OK; if (secure_auth(mpvio)) return CR_ERROR; |