List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:May 16 2011 4:32pm
Subject:bzr commit into mysql-5.5 branch (Georgi.Kodinov:3502) Bug#11766641
View as plain text  
#At file:///Users/kgeorge/mysql/work/B11766641-5.5/ based on revid:georgi.kodinov@stripped

 3502 Georgi Kodinov	2011-05-16
      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 added.

    modified:
      mysql-test/r/plugin_auth.result
      mysql-test/t/plugin_auth.test
      sql/sql_acl.cc
=== modified file 'mysql-test/r/plugin_auth.result'
--- a/mysql-test/r/plugin_auth.result	2011-03-31 13:08:31 +0000
+++ b/mysql-test/r/plugin_auth.result	2011-05-16 16:32:41 +0000
@@ -447,4 +447,12 @@ ORDER BY COLUMN_NAME;
 IS_NULLABLE	COLUMN_NAME
 YES	authentication_string
 YES	plugin
+#
+# Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN 
+#  .-> USING PASSWORD: NO 
+#
+# shoud contain "using password=yes"
+ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: YES)
+# shoud contain "using password=no"
+ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password: NO)
 End of 5.5 tests

=== modified file 'mysql-test/t/plugin_auth.test'
--- a/mysql-test/t/plugin_auth.test	2011-03-31 13:08:31 +0000
+++ b/mysql-test/t/plugin_auth.test	2011-05-16 16:32:41 +0000
@@ -512,4 +512,18 @@ SELECT IS_NULLABLE, COLUMN_NAME FROM INF
   ORDER BY COLUMN_NAME;
 
 
+--echo #
+--echo # Bug # 11766641: 59792: BIN/MYSQL -UUNKNOWN -PUNKNOWN 
+--echo #  .-> USING PASSWORD: NO 
+--echo #
+
+--echo # shoud contain "using password=yes"
+--error 1
+--exec $MYSQL -uunknown -punknown 2>&1
+
+--echo # shoud contain "using password=no"
+--error 1
+--exec $MYSQL -uunknown 2>&1
+
+
 --echo End of 5.5 tests

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2011-03-21 14:22:13 +0000
+++ b/sql/sql_acl.cc	2011-05-16 16:32:41 +0000
@@ -8232,7 +8232,7 @@ static bool find_mpvio_user(MPVIO_EXT *m
 
   if (!mpvio->acl_user)
   {
-    login_failed_error(mpvio, 0);
+    login_failed_error(mpvio, mpvio->auth_info.password_used);
     DBUG_RETURN (1);
   }
 
@@ -8610,6 +8610,14 @@ static ulong parse_client_handshake_pack
       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_null_terminated_string(&end,
                                                   &bytes_remaining_in_packet,


Attachment: [text/bzr-bundle] bzr/georgi.kodinov@oracle.com-20110516163241-nipqfbmvybm0uwr2.bundle
Thread
bzr commit into mysql-5.5 branch (Georgi.Kodinov:3502) Bug#11766641Georgi Kodinov16 May