MySQL 5.6.14 Source Code Document
|
#include <my_global.h>
#include <mysql.h>
#include <mysql/plugin_auth.h>
#include <mysql/client_plugin.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE /* for RTLD_DEFAULT */ |
#define | ORDINARY_QUESTION "\2" |
#define | LAST_QUESTION "\3" |
#define | PASSWORD_QUESTION "\4" |
#define | LAST_PASSWORD "\5" |
Typedefs | |
typedef char *(* | mysql_authentication_dialog_ask_t )(struct st_mysql *mysql, int type, const char *prompt, char *buf, int buf_len) |
Functions | |
mysql_declare_plugin (dialog) | |
mysql_declare_client_plugin (AUTHENTICATION) |
dialog client authentication plugin with examples
dialog is a general purpose client authentication plugin, it simply asks the user the question, as provided by the server and reports the answer back to the server. No encryption is involved, the answers are sent in clear text.
Two examples are provided: two_questions server plugin, that asks the password and an "Are you sure?" question with a reply "yes, of course". It demonstrates the usage of "password" (input is hidden) and "ordinary" (input can be echoed) questions, and how to mark the last question, to avoid an extra roundtrip.
And three_attempts plugin that gives the user three attempts to enter a correct password. It shows the situation when a number of questions is not known in advance.
Definition in file dialog.c.
#define ORDINARY_QUESTION "\2" |
typedef char*(* mysql_authentication_dialog_ask_t)(struct st_mysql *mysql, int type, const char *prompt, char *buf, int buf_len) |
type of the mysql_authentication_dialog_ask function
mysql | mysql |
type | type of the input 1 - ordinary string input 2 - password string |
prompt | prompt |
buf | a buffer to store the use input |
buf_len | the length of the buffer |
a | pointer to the user input string. It may be equal to 'buf' or to 'mysql->password'. In all other cases it is assumed to be an allocated string, and the "dialog" plugin will free() it. |