summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2010-05-04 17:03:28 +0300
committerGeorgi Kodinov <joro@sun.com>2010-05-04 17:03:28 +0300
commit0f26a0533b1feaca62c6d0925114c47f413b2615 (patch)
tree6c90df6423396cfeb8132180ec4ded8de2561681 /sql/sql_yacc.yy
parent83fb8a777068c699e8954eb4dded86789c40c9bc (diff)
parent6ae9c70109d2560b40de3d079099c55c22a557fa (diff)
downloadmariadb-git-0f26a0533b1feaca62c6d0925114c47f413b2615.tar.gz
Bug #53371: COM_FIELD_LIST can be abused to bypass table level grants.
This is the 5.1 merge and extension of the fix. The server was happily accepting paths in table name in all places a table name is accepted (e.g. a SELECT). This allowed all users that have some privilege over some database to read all tables in all databases in all mysql server instances that the server file system has access to. Fixed by : 1. making sure no path elements are allowed in quoted table name when constructing the path (note that the path symbols are still valid in table names when they're properly escaped by the server). 2. checking the #mysql50# prefixed names the same way they're checked for path elements in mysql-5.0.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 4f43ab8bebd..f815da006b1 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -6133,7 +6133,7 @@ alter_list_item:
{
MYSQL_YYABORT;
}
- if (check_table_name($3->table.str,$3->table.length) ||
+ if (check_table_name($3->table.str,$3->table.length, FALSE) ||
($3->db.str && check_db_name(&$3->db)))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), $3->table.str);