diff options
author | unknown <serg@serg.mylan> | 2004-05-29 17:52:20 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-05-29 17:52:20 +0200 |
commit | f1ffa139230da35d789350c5e4502b001b839468 (patch) | |
tree | 08f61e355ca9587836739a2797394f16ca88fc87 /sql | |
parent | a4d82ab8fe2678fd0586fad16bae3e345bb7ef3d (diff) | |
download | mariadb-git-f1ffa139230da35d789350c5e4502b001b839468.tar.gz |
backport wild_compare fix from 4.1 - bug#3924
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_acl.cc | 10 | ||||
-rw-r--r-- | sql/sql_acl.h | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 | ||||
-rw-r--r-- | sql/sql_db.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 4 | ||||
-rw-r--r-- | sql/sql_show.cc | 6 |
6 files changed, 13 insertions, 13 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)) diff --git a/sql/sql_acl.h b/sql/sql_acl.h index bf269e5a7e3..7d8dcfd2079 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -85,7 +85,7 @@ my_bool acl_init(THD *thd, bool dont_read_acl_tables); void acl_reload(THD *thd); void acl_free(bool end=0); 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 acl_getroot(THD *thd, const char *host, const char *ip, const char *user, const char *password,const char *scramble, char **priv_user, char *priv_host, diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6bf0b0bd2ba..c4cad8a8786 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -149,7 +149,7 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *wild) if (wild) { strxmov(name,entry->table_cache_key,".",entry->real_name,NullS); - if (wild_compare(name,wild)) + if (wild_compare(name,wild,0)) continue; } diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 865b2e1328f..2ee725e7432 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -410,7 +410,7 @@ bool mysql_change_db(THD *thd,const char *name) db_access=DB_ACLS; else db_access= (acl_get(thd->host,thd->ip,(char*) &thd->remote.sin_addr, - thd->priv_user,dbname) | + thd->priv_user,dbname,0) | thd->master_access); if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname))) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7e68db0dcd2..7ddbf79c6fe 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2672,7 +2672,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, if (!(thd->master_access & SELECT_ACL) && (db && (!thd->db || strcmp(db,thd->db)))) db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, db); /* purecov: inspected */ + thd->priv_user, db, 0); /* purecov: inspected */ *save_priv=thd->master_access | db_access; DBUG_RETURN(FALSE); } @@ -2692,7 +2692,7 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, if (db && (!thd->db || strcmp(db,thd->db))) db_access=acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, db); /* purecov: inspected */ + thd->priv_user, db, 0); /* purecov: inspected */ else db_access=thd->db_access; // Remove SHOW attribute and access rights we already have diff --git a/sql/sql_show.cc b/sql/sql_show.cc index a4ef735c715..26163ed9bef 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -78,7 +78,7 @@ mysqld_show_dbs(THD *thd,const char *wild) { if (thd->master_access & (DB_ACLS | SHOW_DB_ACL) || acl_get(thd->host, thd->ip, (char*) &thd->remote.sin_addr, - thd->priv_user, file_name) || + thd->priv_user, file_name, 0) || (grant_option && !check_grant_db(thd, file_name))) { thd->packet.length(0); @@ -214,7 +214,7 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path, #endif { if (file->name[0] == '.' || !MY_S_ISDIR(file->mystat->st_mode) || - (wild && wild_compare(file->name,wild))) + (wild && wild_compare(file->name,wild, 0))) continue; } } @@ -232,7 +232,7 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path, if (wild_case_compare(file->name,wild)) continue; } - else if (wild_compare(file->name,wild)) + else if (wild_compare(file->name,wild, 0)) continue; } } |