1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-23010 UPDATE privilege at Database and Table level fail to update with SELECT command denied to user

check both column- and table-level grants when looking for SELECT
privilege on UPDATE statement.
This commit is contained in:
Sergei Golubchik
2020-07-29 12:17:31 +02:00
parent 2ba70f69fd
commit e54a7ac1b3
3 changed files with 39 additions and 3 deletions

View File

@ -7135,9 +7135,13 @@ static void check_grant_column_int(GRANT_TABLE *grant_table, const char *name,
{
if (grant_table)
{
GRANT_COLUMN *grant_column= column_hash_search(grant_table, name, length);
if (grant_column)
*want_access&= ~grant_column->rights;
*want_access&= ~grant_table->privs;
if (*want_access & grant_table->cols)
{
GRANT_COLUMN *grant_column= column_hash_search(grant_table, name, length);
if (grant_column)
*want_access&= ~grant_column->rights;
}
}
}