diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-11-22 21:55:11 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-11-22 21:55:11 +0100 |
commit | d4635150289e5d3d1fc0d9b411296648fe2f8049 (patch) | |
tree | 2550dbd9268100548a89a919e1a3a764c0a26700 /plugin | |
parent | ef45b799245d4c33770339619dab4d717b1e552f (diff) | |
download | mariadb-git-d4635150289e5d3d1fc0d9b411296648fe2f8049.tar.gz |
fix dialog plugin to work on windows
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/auth/CMakeLists.txt | 3 | ||||
-rw-r--r-- | plugin/auth/dialog.c | 18 |
2 files changed, 11 insertions, 10 deletions
diff --git a/plugin/auth/CMakeLists.txt b/plugin/auth/CMakeLists.txt new file mode 100644 index 00000000000..931a47fec5e --- /dev/null +++ b/plugin/auth/CMakeLists.txt @@ -0,0 +1,3 @@ +INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") +SET(AUTH_SOURCES dialog.c) +MYSQL_PLUGIN(AUTH) diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c index 49ab0c9a158..76b2ddae528 100644 --- a/plugin/auth/dialog.c +++ b/plugin/auth/dialog.c @@ -33,13 +33,16 @@ a correct password. It shows the situation when a number of questions is not known in advance. */ -#define _GNU_SOURCE /* for RTLD_DEFAULT */ - -#include <mysql/plugin_auth.h> +#include <my_global.h> #include <mysql/client_plugin.h> +#include <mysql.h> #include <string.h> -#include <stdio.h> -#include <stdlib.h> + +#if defined (_WIN32) +# define RTLD_DEFAULT GetModuleHandle(NULL) +#endif + +#include <mysql/plugin_auth.h> /** first byte of the question string is the question "type". @@ -51,8 +54,6 @@ #define PASSWORD_QUESTION "\4" #define LAST_PASSWORD "\5" -typedef unsigned char uchar; - /********************* SERVER SIDE ****************************************/ /** @@ -216,9 +217,6 @@ maria_declare_plugin_end; dialog plugin will use it for communication with the user. Otherwise a default gets() based implementation will be used. */ -#include <mysql.h> -#include <dlfcn.h> - static mysql_authentication_dialog_ask_t ask; static char *builtin_ask(MYSQL *mysql __attribute__((unused)), |