summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <kaa@polly.local>2007-06-05 22:18:07 +0400
committerunknown <kaa@polly.local>2007-06-05 22:18:07 +0400
commit3ac87034ca389be09ce80d982f0e13f653f98cb4 (patch)
treed9ccc4833205e406de31b8aa54675577b2aa6b5f /sql/sql_acl.cc
parentc04d8460bbdf38603eb68126aaea4952291b848b (diff)
downloadmariadb-git-3ac87034ca389be09ce80d982f0e13f653f98cb4.tar.gz
Fix for bug #28895 "Test 'information_schema_db' fails on i5/OS 32 bit".
In acl_getroot_no_password(), use a separate variable for traversing the acl_users list so that the last entry is not used when no matching entries are found. mysql-test/r/view_grant.result: Fixed the testcase for bug #14875 which relied on broken behavior. sctx->master_access and sctx->priv_user were being set to the last entry in the acl_users list. That does not happen after the patch for bug #28895, so we get a different warning message. sql/sql_acl.cc: In acl_getroot_no_password(), use a separate variable for traversing the acl_users list so that the last entry is not used when no matching entries are found.
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 ebf9385d177..5069d415d30 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -978,14 +978,15 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host,
*/
for (i=0 ; i < acl_users.elements ; i++)
{
- acl_user= dynamic_element(&acl_users,i,ACL_USER*);
- if ((!acl_user->user && !user[0]) ||
- (acl_user->user && strcmp(user, acl_user->user) == 0))
+ ACL_USER *acl_user_tmp= dynamic_element(&acl_users,i,ACL_USER*);
+ if ((!acl_user_tmp->user && !user[0]) ||
+ (acl_user_tmp->user && strcmp(user, acl_user_tmp->user) == 0))
{
- if (compare_hostname(&acl_user->host, host, ip))
+ if (compare_hostname(&acl_user_tmp->host, host, ip))
{
- res= 0;
- break;
+ acl_user= acl_user_tmp;
+ res= 0;
+ break;
}
}
}