28 #include <my_global.h>
40 #define ORDINARY_QUESTION "\2"
41 #define LAST_QUESTION "\3"
42 #define LAST_PASSWORD "\4"
43 #define PASSWORD_QUESTION "\5"
51 static MYSQL_PLUGIN plugin_info_ptr;
54 test_plugin_init (MYSQL_PLUGIN plugin_info)
56 plugin_info_ptr= plugin_info;
70 if (vio->
write_packet(vio, (
const unsigned char *) PASSWORD_QUESTION, 1))
82 my_plugin_log_message(&plugin_info_ptr, MY_ERROR_LEVEL,
83 "Wrong password supplied for %s",
94 my_plugin_log_message(&plugin_info_ptr, MY_INFORMATION_LEVEL,
101 MYSQL_AUTHENTICATION_INTERFACE_VERSION,
131 MYSQL_AUTHENTICATION_INTERFACE_VERSION,
132 "mysql_clear_password",
133 auth_cleartext_plugin
136 mysql_declare_plugin(test_plugin)
138 MYSQL_AUTHENTICATION_PLUGIN,
140 "test_plugin_server",
142 "plugin API test plugin",
153 MYSQL_AUTHENTICATION_PLUGIN,
154 &auth_cleartext_handler,
155 "cleartext_plugin_server",
157 "cleartext plugin API test plugin",
167 mysql_declare_plugin_end;
194 unsigned char *pkt, cmd= 0;
216 reply= mysql->passwd;
223 if (cmd == 0 || cmd == 254)
230 if ((cmd == LAST_PASSWORD[0] || cmd == PASSWORD_QUESTION[0]) && *pkt == 0)
231 reply= mysql->passwd;
238 res= vio->
write_packet(vio, (
const unsigned char *) reply,
245 }
while (cmd != LAST_QUESTION[0] && cmd != PASSWORD_QUESTION[0]);
252 mysql_declare_client_plugin(AUTHENTICATION)
255 "Dialog Client Authentication Plugin",
263 mysql_end_client_plugin;