summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <kroki@mysql.com>2006-05-06 11:25:59 +0400
committerunknown <kroki@mysql.com>2006-05-06 11:25:59 +0400
commit8052fafd313d498362c1cb02d1efff889efea030 (patch)
treeab0b9742983266db02b0f29fbee8c9adaa14b157 /sql/sql_parse.cc
parent77b7a71dd4a642707b57bbf2ab5c7dd2a0c67479 (diff)
downloadmariadb-git-8052fafd313d498362c1cb02d1efff889efea030.tar.gz
Reapply fix for bug#16372 (Server crashes when test 'conc_sys' is running)
after merge. Concurrent read and update of privilege structures (like simultaneous run of SHOW GRANTS and ADD USER) could result in server crash. Ensure that proper locking of ACL structures is done. No test case is provided because this bug can't be reproduced deterministically. sql/sql_acl.cc: Ensure that access to ACL data is protected by acl_cache->lock mutex. Use system_charset_info for host names consistently. Remove check_acl_user(). Use find_acl_user() instead. sql/sql_acl.h: Remove check_acl_user() declaration. sql/sql_parse.cc: Use is_acl_user() instead of check_acl_user().
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 196e723299a..a8de7ff0154 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3835,7 +3835,6 @@ end_with_restore_list:
if (thd->security_ctx->user) // If not replication
{
LEX_USER *user;
- uint counter;
List_iterator <LEX_USER> user_list(lex->users_list);
while ((user= user_list++))
@@ -3853,7 +3852,8 @@ end_with_restore_list:
user->host.str, thd->security_ctx->host_or_ip))
{
// TODO: use check_change_password()
- if (check_acl_user(user, &counter) && user->password.str &&
+ if (is_acl_user(user->host.str, user->user.str) &&
+ user->password.str &&
check_access(thd, UPDATE_ACL,"mysql",0,1,1,0))
{
my_message(ER_PASSWORD_NOT_ALLOWED,