From 416122b29c0f73b6f70cf63a0411cf465fd307a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 May 2007 14:08:04 +0200 Subject: Bug#24988 FLUSH PRIVILEGES causes brief unavailability - A race condition caused brief unavailablility when trying to acccess a table. - The variable 'grant_option' was removed to resolve the race condition and to simplify the design pattern. This flag was originally intended to optimize grant checks. sql/mysql_priv.h: - removed 'grant_option' flag. sql/sql_acl.cc: - removed 'grant_option' flag. sql/sql_db.cc: - removed 'grant_option' flag. sql/sql_insert.cc: - removed 'grant_option' flag. sql/sql_parse.cc: - removed 'grant_option' flag. - removed unnecessary variables found_access, found sql/sql_show.cc: - removed 'grant_option' flag. sql/sql_update.cc: - removed 'grant_option' flag. sql/sql_view.cc: - removed 'grant_option' flag. --- sql/sql_show.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 175588368b3..dd9285c29d4 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -706,7 +706,7 @@ bool mysqld_show_create_db(THD *thd, char *dbname, else db_access= (acl_get(sctx->host, sctx->ip, sctx->priv_user, dbname, 0) | sctx->master_access); - if (!(db_access & DB_ACLS) && (!grant_option || check_grant_db(thd,dbname))) + if (!(db_access & DB_ACLS) && check_grant_db(thd,dbname)) { my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), sctx->priv_user, sctx->host_or_ip, dbname); @@ -2649,7 +2649,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) &thd->col_access, 0, 1, with_i_schema) || sctx->master_access & (DB_ACLS | SHOW_DB_ACL) || acl_get(sctx->host, sctx->ip, sctx->priv_user, base_name,0) || - (grant_option && !check_grant_db(thd, base_name))) + !check_grant_db(thd, base_name)) #endif { List files; @@ -2849,7 +2849,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond) #ifndef NO_EMBEDDED_ACCESS_CHECKS if (sctx->master_access & (DB_ACLS | SHOW_DB_ACL) || acl_get(sctx->host, sctx->ip, sctx->priv_user, file_name,0) || - (grant_option && !check_grant_db(thd, file_name))) + !check_grant_db(thd, file_name)) #endif { load_db_opt_by_name(thd, file_name, &create); -- cgit v1.2.1