diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-05-16 19:46:44 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-05-16 19:46:44 +0300 |
commit | 8f73e64fff57fe4080cfc4d2816555b0d22b9e13 (patch) | |
tree | 9aa2410569c349f7dca2caa7bda01cba64ae8c4b /sql/sql_acl.cc | |
parent | 0fd26247800a6b9abf6eb6895ef47f6b3187be4e (diff) | |
download | mariadb-git-8f73e64fff57fe4080cfc4d2816555b0d22b9e13.tar.gz |
Bug #11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN
.-> USING PASSWORD: NO
The server was always setting the flag for using password to NO and
then relying on the server authentication plugin to update it if it uses
a password.
This creates compatibility problems with 5.1 when rejecting a
nonexistent user login.
Set the default for the password supplied flag for non-existing users
as the default plugin (native password authentication) would do it
for compatibility reasons.
Test case added.
federated.result updated with the correct error message.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7ccb396b036..89b9632b47e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -8232,7 +8232,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio) if (!mpvio->acl_user) { - login_failed_error(mpvio, 0); + login_failed_error(mpvio, mpvio->auth_info.password_used); DBUG_RETURN (1); } @@ -8680,6 +8680,14 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, return packet_error; } + /* + Set the default for the password supplied flag for non-existing users + as the default plugin (native passsword authentication) would do it + for compatibility reasons. + */ + if (passwd_len) + mpvio->auth_info.password_used= PASSWORD_USED_YES; + size_t client_plugin_len= 0; char *client_plugin= get_string(&end, &bytes_remaining_in_packet, &client_plugin_len); |