[MDEV-5175] Revoking a role does not revoke corresponding grants from open sessions Created: 2013-10-23 Updated: 2013-10-23 Resolved: 2013-10-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 10.0.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
If a session has set a role X, revoking this role X from the user does not revoke the grants it provided. Test case:
Output:
|
| Comments |
| Comment by Sergei Golubchik [ 2013-10-23 ] |
|
by design. also, revoking or dropping a role which is enabled (directly or indirectly) does not affect user's global privileges or privileges on the current database, but does affect privileges on the non-current database, table, column, and routine privileges. this is identical to how revoking privileges directly from a user work — which also doesn't affect privileges, cached in the THD. |
| Comment by Elena Stepanova [ 2013-10-23 ] |
|
>> revoking or dropping a role which is enabled (directly or indirectly) does not affect user's global privileges or privileges on the current database, but does affect privileges on the non-current database, table, column, and routine privileges But the example above was about a non-current database, was it not? >> this is identical to how revoking privileges directly from a user work Strange, I don't see the symmetry here. Please consider the following example. user1 is given two symmetrical grants, one for db1 through role1, another one for db2 directly. Then the grants are revoked at the same time; but access to db1 remains, while access to db2 doesn't. --enable_connect_log create user user1@localhost; --connect (con1,localhost,user1,,) --connection default --connection con1 The end of output: Grants for user1@localhost |
| Comment by Sergei Golubchik [ 2013-10-23 ] |
|
"access to db1 remains" was a bug that I've fixed recently, but hasn't pushed yet. Access to the current database will remain, access to the non-current database is affected by grant/revoke — independently whether it was a grant to a role or to a user. |