1
- /* Copyright (c) 2000, 2019 , Oracle and/or its affiliates. All rights reserved.
1
+ /* Copyright (c) 2000, 2020 , Oracle and/or its affiliates. All rights reserved.
2
2
3
3
This program is free software; you can redistribute it and/or modify
4
4
it under the terms of the GNU General Public License, version 2.0,
@@ -659,11 +659,18 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
659
659
DBUG_ENTER (" send_plugin_request_packet" );
660
660
mpvio->status = MPVIO_EXT::FAILURE; // the status is no longer RESTART
661
661
662
- const char *client_auth_plugin=
663
- ((st_mysql_auth *) (plugin_decl (mpvio->plugin )->info ))->client_auth_plugin ;
662
+ std::string client_auth_plugin (
663
+ ((st_mysql_auth *)(plugin_decl (mpvio->plugin )->info ))
664
+ ->client_auth_plugin );
664
665
665
- DBUG_ASSERT (client_auth_plugin);
666
+ DBUG_ASSERT (client_auth_plugin. c_str () );
666
667
668
+ DBUG_EXECUTE_IF (" invalidate_client_auth_plugin" , {
669
+ client_auth_plugin.clear ();
670
+ client_auth_plugin = std::string (" .." ) + std::string (FN_DIRSEP) +
671
+ std::string (" .." ) + std::string (FN_DIRSEP) +
672
+ std::string (" mysql_native_password" );
673
+ });
667
674
/*
668
675
If we're dealing with an older client we can't just send a change plugin
669
676
packet to re-initiate the authentication handshake, because the client
@@ -683,11 +690,11 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
683
690
}
684
691
685
692
DBUG_PRINT (" info" , (" requesting client to use the %s plugin" ,
686
- client_auth_plugin));
693
+ client_auth_plugin. c_str () ));
687
694
DBUG_RETURN (net_write_command (mpvio->protocol ->get_net (),
688
695
switch_plugin_request_buf[0 ],
689
- (uchar*) client_auth_plugin,
690
- strlen ( client_auth_plugin) + 1 ,
696
+ (uchar*) client_auth_plugin. c_str () ,
697
+ client_auth_plugin. size ( ) + 1 ,
691
698
(uchar*) data, data_len));
692
699
}
693
700
0 commit comments