[MDEV-23610] Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that Created: 2020-08-27 Updated: 2021-04-05 Resolved: 2020-11-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Replication |
| Affects Version/s: | 10.5.5 |
| Fix Version/s: | 10.5.9 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Hartmut Holzgraefe | Assignee: | Sujatha Sivakumar (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | privileges, slave | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Sub-Tasks: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
A user that had REPLICATION SLAVE, REPLICATION CLIENT privileges before upgrade to 10.5, has REPLICATION SLAVE, BINLOG MONITOR after upgrade, but is not able to run SHOW SLAVE STATUS anymore, as it is missing the new REPLICATION SLAVE ADMIN privilege now which is necessary for this in 10.5. IMHO mysql_upgrade should take care of replacing REPLICATION CLIENT with BINLOG MONITOR, REPLICATION SLAVE ADMIN when doing a pre-10.5 to 10.5 or later upgrade. Same for REPLICATION SLAVE, that should become REPLICATION SLAVE, REPLICATION MASTER ADMIN, REPLICATION SLAVE ADMIN instead on upgrades to 10.5., so that existing users can still continue to use SHOW SLAVE HOSTS and SHOW RELAYLOG EVENTS. |
| Comments |
| Comment by Geoff Montee (Inactive) [ 2020-08-27 ] | |||||||||||||||||||||||||||||||
|
Should users with SUPER privileges also be granted the other new privileges after upgrading to 10.5? e.g. a mapping like this:
| |||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2020-08-28 ] | |||||||||||||||||||||||||||||||
|
This is intentional and needs to be documented. REPLICATION SLAVE ADMIN allows START SLAVE, STOP SLAVE, and CHANGE MASTER statements. This is not the kind of power you want to grant automatically to everyone who used to do SHOW SLAVE STATUS. | |||||||||||||||||||||||||||||||
| Comment by Nick (Inactive) [ 2020-09-09 ] | |||||||||||||||||||||||||||||||
|
The core issue is that SHOW SLAVE STATUS worked for a user before upgrade and no longer works (without manual intervention afterwards). This is an issue for customers as noted in the original report who expect previously working commands to function after upgrade. Is there a less permissive option that allows just SHOW SLAVE STATUS or does that now give more privileges than it did previously? | |||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2020-09-10 ] | |||||||||||||||||||||||||||||||
|
Unfortunately, there is no less permissive option that allows just SHOW SLAVE STATUS at the moment. | |||||||||||||||||||||||||||||||
| Comment by Nick (Inactive) [ 2020-09-23 ] | |||||||||||||||||||||||||||||||
|
In order to make upgrades work, should we give SHOW SLAVE STATUS to an existing privilege (besides REPLICATION SLAVE ADMIN) or add a new privilege and give that to users on upgrade, or something else? | |||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2020-09-24 ] | |||||||||||||||||||||||||||||||
|
Generally we try to avoid having more than one privilege to allow a specific action. There are few historical instances of that, but we'd rather not to add more. Adding a new privilege could be possible. We tried to strike the balance between having a fine-grained privilege system and swamping users with hundreds of privileges to learn. It could as well be that we've misjudged this one. bar, what do you think? | |||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-09-24 ] | |||||||||||||||||||||||||||||||
|
I agree with serg, this is a balance, so we tried not to introduce too many new privileges. But if the choice is between:
then I'd probably go with the latter (b). I think (b) should be easier for DBAs to remember, when every protected feature is consistently controlled by a single privilege, and only by this privilege. (with SUPER being the only exception) | |||||||||||||||||||||||||||||||
| Comment by Max Mether [ 2020-09-24 ] | |||||||||||||||||||||||||||||||
|
I think they key here is that functionality should not be different after an upgrade. If a user had REPLICATION SLAVE and REPLICATION CLIENT in 10.4 he should be able to do the same functions after an upgrade to 10.5. I think that is the baseline. So either 1) we do what Geoff's table suggests above (ie replace the old REPLICATION SLAVE with REPLICATION SLAVE, REPLICATION MASTER ADMIN, REPLICATION SLAVE ADMIN and replace the old REPLICATION CLIENT with BINLOG MONITOR, REPLICATION SLAVE ADMIN) or 2) we introduce a new privilege that allows him to just issue SHOW SLAVE STATUS I think 1) is easier and less intrusive but I would be fine with 2) as well. We just need to make sure that people can upgrade without it affecting their application. | |||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2020-10-08 ] | |||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||
| Comment by Sujatha Sivakumar (Inactive) [ 2020-11-11 ] | |||||||||||||||||||||||||||||||
|
Hello Sergie, Can you please review the fix. Patch: https://github.com/MariaDB/server/commit/d66d5457589dba526b358183ea795ddd860f45e6 Buildbot testing: http://buildbot.askmonty.org/buildbot/grid?category=main&branch=bb-10.5-sujatha Most of the fix is implemented as an extension to
Initially I added the changes as part of
But it breaks main.grant.test
bar suggested that "The new bit should probably also go inside some of if (num_fields() <= XXX) code branches." Hence I added the new bit setting part to generic code. Please suggest if it fine or needs refinement. Thank you. | |||||||||||||||||||||||||||||||
| Comment by Andrei Elkin [ 2020-11-25 ] | |||||||||||||||||||||||||||||||
|
nicklamb: The summary of the fixes
|