[MDEV-30023] Revoking Privilege on the Column Yields the Error Created: 2022-11-16  Updated: 2022-11-30  Resolved: 2022-11-30

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 10.3, 10.4, 10.6.11, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
Fix Version/s: 10.11.2, 10.3.38, 10.4.28, 10.5.19, 10.6.12, 10.7.8, 10.8.7, 10.9.5, 10.10.3

Type: Bug Priority: Blocker
Reporter: Lawrin Novitsky Assignee: Vicențiu Ciorbaru
Resolution: Fixed Votes: 0
Labels: regression

Issue Links:
Problem/Incident
is caused by MDEV-29465 Inherited columns privs for roles wro... Closed
Relates

 Description   

It's a regression in latest version 10.6.11, I did not try with other branches. But it used to work before this release.

How to repeat:

MariaDB [INFORMATION_SCHEMA]> CREATE TABLE test.test_getcolpriv(col1 INT, col2 INT);
Query OK, 0 rows affected (0.041 sec)
MariaDB [INFORMATION_SCHEMA]> GRANT SELECT (col1,col2) ON test.test_getcolpriv TO 'root';
Query OK, 0 rows affected (0.025 sec)
MariaDB [INFORMATION_SCHEMA]> GRANT INSERT (col1) ON test.test_getcolpriv TO 'root';
Query OK, 0 rows affected (0.025 sec)
 
MariaDB [INFORMATION_SCHEMA]> REVOKE SELECT (col1,col2) ON test.test_getcolpriv FROM 'root';
Query OK, 0 rows affected (0.025 sec)
MariaDB [INFORMATION_SCHEMA]> REVOKE INSERT (col1) ON test.test_getcolpriv FROM 'root';
ERROR 1147 (42000): There is no such grant defined for user 'root' on host '%' on table 'test_getcolpriv'

FLUSH PRIVILEGES in between fixes the thing. Also, any one GRANT/REVOKE from these two do not result in the error



 Comments   
Comment by Alice Sherepa [ 2022-11-18 ]

caused by 145932a57b3ffba4ebab25aa5 (MDEV-29465: Inherited columns privs for roles wrongly set mysql.table…)

Comment by Vicențiu Ciorbaru [ 2022-11-25 ]

Hi serg

Can you please review the patch at https://github.com/MariaDB/server/commit/6ed475f25cc20e88c66f52e13e691a2d8b0615e4

All tests pass. The issue was caused by an incomplete update of GRANT_COLUMNS::rights vs GRANT_COLUMN::init_rights in replace_column_table.

Comment by Sergei Golubchik [ 2022-11-29 ]

6ed475f25cc2 is ok to push

Generated at Thu Feb 08 10:13:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.