summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-05-07 23:59:24 +0300
committerunknown <monty@mashka.mysql.fi>2003-05-07 23:59:24 +0300
commita57e7732897ee7973d82dccea0425c436845066a (patch)
treedaddc57eeedc8a9ecec290538f8ecd00e81c06bb /sql/sql_acl.cc
parentd4b465e2f3e871af1f5e7260055b4055bbe2a3f7 (diff)
downloadmariadb-git-a57e7732897ee7973d82dccea0425c436845066a.tar.gz
Security patch to remove wrong error when one had a global update/delete privilige and a database specific SELECT privilege.
sql/sql_acl.cc: Security patch sql/sql_base.cc: Security patch sql/sql_parse.cc: Security patch tests/grant.pl: Test of security patch tests/grant.res: Test of security patch
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 05ec57b134a..f36e39b0645 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2118,8 +2118,8 @@ bool check_grant(THD *thd, uint want_access, TABLE_LIST *tables,
}
-bool check_grant_column (THD *thd,TABLE *table, const char *name,
- uint length, uint show_tables)
+bool check_grant_column(THD *thd,TABLE *table, const char *name,
+ uint length, uint show_tables)
{
GRANT_TABLE *grant_table;
GRANT_COLUMN *grant_column;
@@ -2127,6 +2127,8 @@ bool check_grant_column (THD *thd,TABLE *table, const char *name,
uint want_access=table->grant.want_privilege;
if (!want_access)
return 0; // Already checked
+ if (!grant_option)
+ goto err2;
pthread_mutex_lock(&LOCK_grant);
@@ -2158,8 +2160,9 @@ bool check_grant_column (THD *thd,TABLE *table, const char *name,
#endif
/* We must use my_printf_error() here! */
- err:
+err:
pthread_mutex_unlock(&LOCK_grant);
+err2:
if (!show_tables)
{
const char *command="";