[MDEV-12183] Can't create "new password" users on old_passwords=1 replication setup Created: 2017-03-06 Updated: 2017-05-21 Resolved: 2017-05-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Replication |
| Affects Version/s: | 10.1.21 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | None | ||
| Description |
|
When having both master and slave set up with old_passwords=1 it is possible to create users with new password hash format by setting old_passwords=0 on the session level. The slave will break on this though as the variable setting is not replicated, and so either the old format is used on the slave, or an error about wrong password hash size is raised on the slave side, stopping the slave SQL thread, when giving the password hash value directly. How to reproduce: First create a replication setup where old_passwords=1 is the default global setting for both master and slave. Then, on the master:
On the slave user was created with old password format:
Now lets try to set the password hash directly on the master side:
This breaks the slave:
The only workaround for now seems to be to use CREATE USER without password first, then to UPDATE the password column in the mysql.user column directly, followed by a FLUSH PRIVILEGES. This gets replicated to the slave correctly.
|
| Comments |
| Comment by Elena Stepanova [ 2017-03-06 ] | ||
|
Theoretically, I'd say it's the same principle that applies to any "New" Master => "Old" Slave replication – if the master uses a feature which does not exist (turned off, disabled) on the slave, replication is not guaranteed to work. However, if it's a real-life use cause which is on some reason important, I suppose something can be done about it. Assigning to serg to decide. | ||
| Comment by Hartmut Holzgraefe [ 2017-03-06 ] | ||
|
Thinking again the better workaround, assuming that all future user accounts are supposed to get created with the new hash format, is to simply have
on master and slave. If both old and new format passwords need to be maintained (due to some old pre-4.1 clients, while all others shall use the newer has format) the "direct UPGRADE + FLUSH PRIVILIEGES" approach still seems to be the only viable workaround option for now though ... | ||
| Comment by Sergei Golubchik [ 2017-04-26 ] | ||
|
I'd rather remove old_password variable completely in 10.3. Nobody should be using old authentication nowadays.
|