@@ -2554,7 +2554,8 @@ update_user_table(THD *thd, TABLE *table,
2554
2554
2555
2555
table->field [(int ) password_field]->store (new_password, new_password_len,
2556
2556
system_charset_info);
2557
- if (new_password_len == SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
2557
+ if (new_password_len == SCRAMBLED_PASSWORD_CHAR_LENGTH_323 &&
2558
+ password_field == MYSQL_USER_FIELD_PASSWORD)
2558
2559
WARN_DEPRECATED_41_PWD_HASH (thd);
2559
2560
2560
2561
if ((error=table->file ->ha_update_row (table->record [1 ],table->record [0 ])) &&
@@ -2659,8 +2660,6 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
2659
2660
2660
2661
mysql_mutex_assert_owner (&acl_cache->lock );
2661
2662
2662
- if (combo->password .length == SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
2663
- WARN_DEPRECATED_41_PWD_HASH (thd);
2664
2663
table->use_all_columns ();
2665
2664
DBUG_ASSERT (combo->host .str != ' \0 ' );
2666
2665
table->field [MYSQL_USER_FIELD_HOST]->store (combo->host .str ,combo->host .length ,
@@ -2766,6 +2765,8 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
2766
2765
#endif
2767
2766
{
2768
2767
/* Use the legacy Password field */
2768
+ if (combo->password .length == SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
2769
+ WARN_DEPRECATED_41_PWD_HASH (thd);
2769
2770
table->field [MYSQL_USER_FIELD_PASSWORD]->store (password, password_len,
2770
2771
system_charset_info);
2771
2772
table->field [MYSQL_USER_FIELD_AUTHENTICATION_STRING]->store (" \0 " , 0 ,
@@ -2867,6 +2868,8 @@ static int replace_user_table(THD *thd, TABLE *table, LEX_USER *combo,
2867
2868
#endif
2868
2869
{
2869
2870
/* The legacy Password field is used */
2871
+ if (combo->password .length == SCRAMBLED_PASSWORD_CHAR_LENGTH_323)
2872
+ WARN_DEPRECATED_41_PWD_HASH (thd);
2870
2873
table->field [MYSQL_USER_FIELD_PASSWORD]->
2871
2874
store (password, password_len, system_charset_info);
2872
2875
table->field [MYSQL_USER_FIELD_AUTHENTICATION_STRING]->
@@ -8725,7 +8728,7 @@ void init_default_auth_plugin()
8725
8728
8726
8729
int set_default_auth_plugin (char *plugin_name, int plugin_name_length)
8727
8730
{
8728
- // TODO verify that the auth plugin is present
8731
+ # if defined(HAVE_OPENSSL)
8729
8732
default_auth_plugin_name.str = plugin_name;
8730
8733
default_auth_plugin_name.length = plugin_name_length;
8731
8734
@@ -8740,6 +8743,7 @@ int set_default_auth_plugin(char *plugin_name, int plugin_name_length)
8740
8743
*/
8741
8744
global_system_variables.old_passwords = 2 ;
8742
8745
}
8746
+ #endif
8743
8747
#endif
8744
8748
return 0 ;
8745
8749
}
@@ -11135,8 +11139,7 @@ mysql_declare_plugin(mysql_password)
11135
11139
NULL , /* config options */
11136
11140
0 , /* flags */
11137
11141
}
11138
- #ifdef HAVE_OPENSSL
11139
- #ifndef HAVE_YASSL
11142
+ #if defined(HAVE_OPENSSL) && !defined(HAVE_YASSL)
11140
11143
,
11141
11144
{
11142
11145
MYSQL_AUTHENTICATION_PLUGIN, /* type constant */
@@ -11154,6 +11157,5 @@ mysql_declare_plugin(mysql_password)
11154
11157
0 /* flags */
11155
11158
}
11156
11159
#endif
11157
- #endif
11158
11160
mysql_declare_plugin_end;
11159
11161
0 commit comments