diff options
author | unknown <tim@threads.polyesthetic.msg> | 2001-05-22 16:21:07 -0400 |
---|---|---|
committer | unknown <tim@threads.polyesthetic.msg> | 2001-05-22 16:21:07 -0400 |
commit | f58ae5e3477d5f232e4385e16ff6c8555c8d553d (patch) | |
tree | b230636d3a7d425e6953c5e66bf78501d944dc6c /sql/sql_parse.cc | |
parent | 188349dd96a0ed3a923c630f6f81262e079ae2b1 (diff) | |
download | mariadb-git-f58ae5e3477d5f232e4385e16ff6c8555c8d553d.tar.gz |
Security fix: LOCK TABLES must check for sufficient privileges.
sql/sql_parse.cc:
Check table access for SQLCOM_LOCK_TABLES.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7a94dc32997..e420918e06d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1851,6 +1851,15 @@ mysql_execute_command(void) } if (check_db_used(thd,tables) || end_active_trans(thd)) goto error; + for (TABLE_LIST *tmp = tables; tmp; tmp = tmp->next) + { + if (!(tmp->lock_type == TL_READ_NO_INSERT ? + !check_table_access(thd, SELECT_ACL, tmp) : + (!check_table_access(thd, INSERT_ACL, tmp) || + !check_table_access(thd, UPDATE_ACL, tmp) || + !check_table_access(thd, DELETE_ACL, tmp)))) + goto error; + } thd->in_lock_tables=1; if (!(res=open_and_lock_tables(thd,tables))) { |