[MDEV-16774] SET PASSWORD and ALTER USER with slightly different results Created: 2018-07-18 Updated: 2019-03-18 Resolved: 2019-03-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System |
| Affects Version/s: | 10.3.8, 10.3.11, 10.2, 10.3 |
| Fix Version/s: | 10.3.11, 10.2.19 |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Krämer | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Environment: |
Debian Stretch |
||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
Just create two users:
Edit password with ALTER USER:
Edit password with SET PASSWORD:
Result:
Is this intended behavior? |
| Comments |
| Comment by Elena Stepanova [ 2018-07-18 ] | |||||||||||||||||||||||||||||||||||||||
|
Thanks for the report. I'm setting it to confirmed, although given the task | |||||||||||||||||||||||||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2018-07-19 ] | |||||||||||||||||||||||||||||||||||||||
|
Right, this is an oversight. Privileges still work properly, it's a "cosmetic" thing. When checking if a user has a password or not we will use password column with mysql_native_password (or the old auth if password is in short format) if plugin and authentication_string are not set. SET PASSWORD will play with plugin and authentication string values and clear the password column while alter user will use the password column if it can. Inconsistent, but it won't affect server behaviour with regards to passwords and authentication. If you don't look at mysql.user table, you won't notice a change serg what do you think? Should we update the code in 10.2 or just scrap the password column altogether in 10.4 and leave this behaviour as is? | |||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Krämer [ 2018-07-19 ] | |||||||||||||||||||||||||||||||||||||||
|
Just for your information: | |||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-07-19 ] | |||||||||||||||||||||||||||||||||||||||
|
This is, probably, caused by my fix for In that fix I made SET PASSWORD to use the authentication_string and clear the password column. It was to avoid the cases when both are set making the behavior ambiguous. Apparently, CREATE USER does the opposite, prefers password column. I don't think it matters much, as long as authentication_string and password are never set both at the same time. | |||||||||||||||||||||||||||||||||||||||
| Comment by markus makela [ 2018-10-26 ] | |||||||||||||||||||||||||||||||||||||||
|
This affects MaxScale and also needs to be fixed there ( | |||||||||||||||||||||||||||||||||||||||
| Comment by Alfredo Moralejo [ 2019-02-19 ] | |||||||||||||||||||||||||||||||||||||||
|
According to the info in this issue, this is fixed in 10.3.11. However I'm testing it and i still have doubts about the behavior. When creating a user with: create user foo2 identified with mysql_native_password as '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB'; Shouldn't this populate authentication_string with the password and mysql_native_password in plugin. what I actually find is:
If i change the password using alter user:
Only using set password updates authentication_string:
My understanding is that this behavior is not the expected one. I'm using 10.3.12:
| |||||||||||||||||||||||||||||||||||||||
| Comment by Radoslav Bodó [ 2019-02-24 ] | |||||||||||||||||||||||||||||||||||||||
|
I agree with @Alfredo Moralejo , the issue is still present on 10.3.12 from debian buster. please consider making create user, alter user and set password strongly consistent, otherwise it would break many configuration management engines. | |||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Black [ 2019-02-28 ] | |||||||||||||||||||||||||||||||||||||||
|
Not consistent as above test. | |||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2019-03-04 ] | |||||||||||||||||||||||||||||||||||||||
|
The fix in the commit dd6e74c62a2 made sure that the password field is always set, because that was the original issue that broke third-party tools. Other differences between password and authentication_string were removed in 10.4. |