diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-07-03 10:22:43 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-07-03 10:22:43 +0300 |
commit | c3289d27eef39a47fed2ce1ff239013ed6870f39 (patch) | |
tree | 2a6e2434287921eb6f5f7c7877e8da061803ed9e /sql/sql_acl.cc | |
parent | 358ae4b46dd52b329154cff901b58e96fd223773 (diff) | |
parent | eaab98f7022732b26b4ea590e1bb44308e253be8 (diff) | |
download | mariadb-git-c3289d27eef39a47fed2ce1ff239013ed6870f39.tar.gz |
Merge mariadb-10.3.8 into 10.3
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index aec15d38847..d00ee3e07ef 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3766,7 +3766,8 @@ bool hostname_requires_resolving(const char *hostname) void set_authentication_plugin_from_password(const User_table& user_table, const char* password, size_t password_length) { - if (password_length == SCRAMBLED_PASSWORD_CHAR_LENGTH) + if (password_length == SCRAMBLED_PASSWORD_CHAR_LENGTH || + password_length == 0) { user_table.plugin()->store(native_password_plugin_name.str, native_password_plugin_name.length, @@ -3821,13 +3822,16 @@ static bool update_user_table(THD *thd, const User_table& user_table, DBUG_RETURN(1); /* purecov: deadcode */ } store_record(table,record[1]); - /* If the password column is missing, we use the - authentication_string column. */ - if (user_table.password()) - user_table.password()->store(new_password, new_password_len, system_charset_info); - else + + if (user_table.plugin()) + { set_authentication_plugin_from_password(user_table, new_password, new_password_len); + new_password_len= 0; + } + + if (user_table.password()) + user_table.password()->store(new_password, new_password_len, system_charset_info); if (unlikely(error= table->file->ha_update_row(table->record[1], @@ -7540,7 +7544,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, INSERT_ACL : SELECT_ACL); } - if (tl->with || + if (tl->with || !tl->db.str || (tl->select_lex && (tl->with= tl->select_lex->find_table_def_in_with_clauses(tl)))) continue; |