[MDEV-11180] CREATE USER .. IDENTIFIED WITH .. BY .. is not supported Created: 2016-10-30 Updated: 2018-05-23 Resolved: 2018-05-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Admin statements, Authentication and Privilege System |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 10.2.6-2, 10.2.6-3, 10.3.1-1 | ||||||||||||
| Description |
|
According to
I'm not sure if it is supposed to work, but it's worth checking. |
| Comments |
| Comment by Vicențiu Ciorbaru [ 2017-03-25 ] | |||||||||||||||||||||||||||||||||||||||
|
Investigated how MySQL does this. First, their documentation mentions:
This doesn't explain how the hash is calculated. Trying out tests in the MySQL server reveals the following: When doing:
We get a different hash value then:
This hints that the logic is different between authentication plugins. Looking for the code that detects this:
We find this function call that takes the authentication string passed by the parser and passes it forward to the plugin itself. This is newly introduced API for authentication plugins.
Our current implementation does not allow for easy introduction of this behavior. I would not do it in 10.2. I would adjust the documentation to not allow BY syntax for IDENTIFIED WITH <plugin> BY <not_hashed_auth_string>, as it currently is in the server code. We could implement this in 10.3. | |||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2017-03-26 ] | |||||||||||||||||||||||||||||||||||||||
|
Agree. In fact, I've created Although I didn't think about IDENTIFIED WITH ... BY ... — I find it ridiculous to have all the that variants:
while keeping in mind that with BY "data" is a plain-text password, while with other variants it's a hash. BY does not have this meaning, it's something one has to remember for this specific use case. I thought about something like
which would match the existing syntax of
So, "data" by default is a hash of the password. That is, "data" is exactly what's stored in mysql.user.auth_string column. And by using PASSWORD(...) syntax one can call the plugin method to convert the "data" into the format that goes into mysql.user.auth_string column. |