Skip to content

Commit 6d7acee

Browse files
committed
Bug#11766631 (59780) - Move the client authentication_windows plugin
into the server repository This patch adds client windows authentication plugin code to the client library libmysql (only on Windows platform). The plugin is compiled into the library and added to the list of built-in plugins. This way clients should be able to connect to a server which uses windows authentication plugin even as an SQL user which uses such authentication. Note: this makes the client library to depend on Secur32 Windows system library. When building clients, they must be linked against Secur32. Command mysql_config --libs correctly lists Secur32 as a required dependency.
1 parent d410bdb commit 6d7acee

File tree

10 files changed

+1685
-1
lines changed

10 files changed

+1685
-1
lines changed

libmysql/CMakeLists.txt

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -134,6 +134,12 @@ CACHE INTERNAL "Functions exported by client API"
134134

135135
)
136136

137+
IF(WIN32)
138+
ADD_SUBDIRECTORY(authentication_win)
139+
SET(WITH_AUTHENTICATION_WIN 1)
140+
ADD_DEFINITIONS(-DAUTHENTICATION_WIN)
141+
ENDIF(WIN32)
142+
137143
SET(CLIENT_SOURCES
138144
get_password.c
139145
libmysql.c
@@ -151,6 +157,10 @@ ADD_DEPENDENCIES(clientlib GenError)
151157

152158
SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL})
153159

160+
IF(WITH_AUTHENTICATION_WIN)
161+
LIST(APPEND LIBS auth_win_client)
162+
ENDIF(WITH_AUTHENTICATION_WIN)
163+
154164
# Merge several convenience libraries into one big mysqlclient
155165
# and link them together into shared library.
156166
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development)
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
#
17+
# Configuration for building Windows Authentication Plugin (client-side)
18+
#
19+
20+
ADD_DEFINITIONS(-DSECURITY_WIN32)
21+
ADD_DEFINITIONS(-DDEBUG_ERRROR_LOG) # no error logging in production builds
22+
23+
SET(HEADERS common.h handshake.h)
24+
SET(PLUGIN_SOURCES plugin_client.cc handshake_client.cc log_client.cc common.cc handshake.cc)
25+
26+
ADD_CONVENIENCE_LIBRARY(auth_win_client ${PLUGIN_SOURCES} ${HEADERS})
27+
TARGET_LINK_LIBRARIES(auth_win_client Secur32)
28+
29+
# In IDE, group headers in a separate folder.
30+
31+
SOURCE_GROUP(Headers REGULAR_EXPRESSION ".*h$")

0 commit comments

Comments
 (0)