1 /* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
15
16 #include <my_global.h>
17 #include <mysql.h>
18 #include <mysql/plugin_auth.h>
19 #include <mysql/client_plugin.h>
20
21 #include "common.h"
22
23 /*
24 The following MS C++ specific pragma embeds a comment in the resulting
25 object file. A "lib" comment tells the linker to use the specified
26 library, thus the dependency is handled automagically.
27 */
28
29 #ifdef _MSC_VER
30 #pragma comment(lib, "Secur32")
31 #endif
32
win_auth_client_plugin_init(char *,size_t,int,va_list)33 static int win_auth_client_plugin_init(char*, size_t, int, va_list)
34 {
35 return 0;
36 }
37
38
win_auth_client_plugin_deinit()39 static int win_auth_client_plugin_deinit()
40 {
41 return 0;
42 }
43
44
45 int win_auth_handshake_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql);
46
47
48 /*
49 Client plugin declaration. This is added to mysql_client_builtins[]
50 in sql-common/client.c
51 */
52
53 extern "C"
54 st_mysql_client_plugin_AUTHENTICATION win_auth_client_plugin=
55 {
56 MYSQL_CLIENT_AUTHENTICATION_PLUGIN,
57 MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION,
58 "authentication_windows_client",
59 "Rafal Somla",
60 "Windows Authentication Plugin - client side",
61 {0,1,0},
62 "GPL",
63 NULL,
64 win_auth_client_plugin_init,
65 win_auth_client_plugin_deinit,
66 NULL, // option handling
67 win_auth_handshake_client
68 };
69