Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.3(EOL)
-
None
Description
The following test case shows that mysql.tables_priv is wrongly populated
create user foo; |
create database some_db; |
create table some_db.t1 (a int, b int, secret int); |
create role r_select_column; |
create role r_active_column; |
grant r_select_column to r_active_column; |
grant r_active_column to foo; |
grant select(a) on some_db.t1 to r_select_column; |
select * from mysql.tables_priv order by user; |
Host Db User Table_name Grantor Timestamp Table_priv Column_priv |
some_db r_select_column t1 root@localhost 0000-00-00 00:00:00 Select |
grant insert(a) on some_db.t1 to r_active_column; |
select * from mysql.tables_priv order by user; |
Host Db User Table_name Grantor Timestamp Table_priv Column_priv |
some_db r_active_column t1 root@localhost 0000-00-00 00:00:00 Select, Insert |
some_db r_select_column t1 root@localhost 0000-00-00 00:00:00 Select |
-- There shouldn't be `Select` priv stored in Column_priv for r_active_column! |
The cause of this bug is the mixing of GRANT_TABLE::cols and GRANT_TABLE::init_cols within the mysql_table_grant function.
There is a similar bug for GRANT_COLUMN::rights and GRANT_COLUMN::init_rights.
Attachments
Issue Links
- blocks
-
MDEV-14443 DENY clause for access control a.k.a. "negative grants"
-
- Stalled
-
- causes
-
MDEV-30023 Revoking Privilege on the Column Yields the Error
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Vicențiu Ciorbaru [ cvicentiu ] |
Description |
The following test case shows that mysql.tables_priv is wrongly populated
{code:sql} create user foo; create database some_db; create table some_db.t1 (a int, b int, secret int); create role r_select_column; create role r_active_column; grant r_select_column to r_active_column; grant r_active_column to foo; grant select(a) on some_db.t1 to r_select_column; select * from mysql.tables_priv order by user; Host Db User Table_name Grantor Timestamp Table_priv Column_priv some_db r_select_column t1 root@localhost 0000-00-00 00:00:00 Select grant insert(a) on some_db.t1 to r_active_column; select * from mysql.tables_priv order by user; Host Db User Table_name Grantor Timestamp Table_priv Column_priv some_db r_active_column t1 root@localhost 0000-00-00 00:00:00 Insert some_db r_select_column t1 root@localhost 0000-00-00 00:00:00 Select, Insert -- There shouldn't be `Select` priv stored in Column_priv! {code} The cause of this bug is the mixing of {{GRANT_TABLE::cols}} and {{GRANT_TABLE::init_cols}} within the {{mysql_table_grant}} function. There is a similar bug for {{GRANT_COLUMN::rights}} and {{GRANT_COLUMN::init_rights}}. |
Fix Version/s | 10.3 [ 22126 ] |
Description |
The following test case shows that mysql.tables_priv is wrongly populated
{code:sql} create user foo; create database some_db; create table some_db.t1 (a int, b int, secret int); create role r_select_column; create role r_active_column; grant r_select_column to r_active_column; grant r_active_column to foo; grant select(a) on some_db.t1 to r_select_column; select * from mysql.tables_priv order by user; Host Db User Table_name Grantor Timestamp Table_priv Column_priv some_db r_select_column t1 root@localhost 0000-00-00 00:00:00 Select grant insert(a) on some_db.t1 to r_active_column; select * from mysql.tables_priv order by user; Host Db User Table_name Grantor Timestamp Table_priv Column_priv some_db r_active_column t1 root@localhost 0000-00-00 00:00:00 Insert some_db r_select_column t1 root@localhost 0000-00-00 00:00:00 Select, Insert -- There shouldn't be `Select` priv stored in Column_priv! {code} The cause of this bug is the mixing of {{GRANT_TABLE::cols}} and {{GRANT_TABLE::init_cols}} within the {{mysql_table_grant}} function. There is a similar bug for {{GRANT_COLUMN::rights}} and {{GRANT_COLUMN::init_rights}}. |
The following test case shows that mysql.tables_priv is wrongly populated
{code:sql} create user foo; create database some_db; create table some_db.t1 (a int, b int, secret int); create role r_select_column; create role r_active_column; grant r_select_column to r_active_column; grant r_active_column to foo; grant select(a) on some_db.t1 to r_select_column; select * from mysql.tables_priv order by user; Host Db User Table_name Grantor Timestamp Table_priv Column_priv some_db r_select_column t1 root@localhost 0000-00-00 00:00:00 Select grant insert(a) on some_db.t1 to r_active_column; select * from mysql.tables_priv order by user; Host Db User Table_name Grantor Timestamp Table_priv Column_priv some_db r_active_column t1 root@localhost 0000-00-00 00:00:00 Select, Insert some_db r_select_column t1 root@localhost 0000-00-00 00:00:00 Select -- There shouldn't be `Select` priv stored in Column_priv for r_active_column! {code} The cause of this bug is the mixing of {{GRANT_TABLE::cols}} and {{GRANT_TABLE::init_cols}} within the {{mysql_table_grant}} function. There is a similar bug for {{GRANT_COLUMN::rights}} and {{GRANT_COLUMN::init_rights}}. |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Vicențiu Ciorbaru [ cvicentiu ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Link | This issue blocks MDEV-14443 [ MDEV-14443 ] |
Priority | Major [ 3 ] | Critical [ 2 ] |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.9 [ 26905 ] |
Assignee | Sergei Golubchik [ serg ] | Vicențiu Ciorbaru [ cvicentiu ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.3.37 [ 28404 ] | |
Fix Version/s | 10.4.27 [ 28405 ] | |
Fix Version/s | 10.5.18 [ 28421 ] | |
Fix Version/s | 10.6.10 [ 28407 ] | |
Fix Version/s | 10.7.6 [ 28408 ] | |
Fix Version/s | 10.8.5 [ 28308 ] | |
Fix Version/s | 10.9.3 [ 28409 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Fix Version/s | 10.6.11 [ 28441 ] | |
Fix Version/s | 10.7.7 [ 28442 ] | |
Fix Version/s | 10.8.6 [ 28443 ] | |
Fix Version/s | 10.9.4 [ 28444 ] | |
Fix Version/s | 10.8.5 [ 28308 ] | |
Fix Version/s | 10.6.10 [ 28407 ] | |
Fix Version/s | 10.7.6 [ 28408 ] | |
Fix Version/s | 10.9.3 [ 28409 ] |
Link |
This issue causes |
Hi Sergei!
While working on negative grants, I identified this bug.
https://github.com/MariaDB/server/pull/2256
Please review a fix for this.
Vicențiu