summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-05-29 17:52:20 +0200
committerunknown <serg@serg.mylan>2004-05-29 17:52:20 +0200
commitf1ffa139230da35d789350c5e4502b001b839468 (patch)
tree08f61e355ca9587836739a2797394f16ca88fc87 /sql/sql_acl.cc
parenta4d82ab8fe2678fd0586fad16bae3e345bb7ef3d (diff)
downloadmariadb-git-f1ffa139230da35d789350c5e4502b001b839468.tar.gz
backport wild_compare fix from 4.1 - bug#3924
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 6d2f662b7df..9b676442995 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -834,7 +834,7 @@ static void acl_insert_db(const char *user, const char *host, const char *db,
*/
ulong acl_get(const char *host, const char *ip, const char *bin_ip,
- const char *user, const char *db)
+ const char *user, const char *db, my_bool db_is_pattern)
{
ulong host_access,db_access;
uint i,key_length;
@@ -868,7 +868,7 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
{
if (compare_hostname(&acl_db->host,host,ip))
{
- if (!acl_db->db || !wild_compare(db,acl_db->db))
+ if (!acl_db->db || !wild_compare(db,acl_db->db,db_is_pattern))
{
db_access=acl_db->access;
if (acl_db->host.hostname)
@@ -890,7 +890,7 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
ACL_HOST *acl_host=dynamic_element(&acl_hosts,i,ACL_HOST*);
if (compare_hostname(&acl_host->host,host,ip))
{
- if (!acl_host->db || !wild_compare(db,acl_host->db))
+ if (!acl_host->db || !wild_compare(db,acl_host->db,0))
{
host_access=acl_host->access; // Fully specified. Take it
break;
@@ -1222,7 +1222,7 @@ static bool compare_hostname(const acl_host_and_ip *host, const char *hostname,
}
return (!host->hostname ||
(hostname && !wild_case_compare(hostname,host->hostname)) ||
- (ip && !wild_compare(ip,host->hostname)));
+ (ip && !wild_compare(ip,host->hostname,0)));
}
@@ -1300,7 +1300,7 @@ static bool test_if_create_new_users(THD *thd)
tl.db= (char*) "mysql";
tl.real_name= (char*) "user";
db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr,
- thd->priv_user, tl.db);
+ thd->priv_user, tl.db, 0);
if (!(db_access & INSERT_ACL))
{
if (check_grant(thd,INSERT_ACL,&tl,0,1))