File tree 7 files changed +31
-54
lines changed
7 files changed +31
-54
lines changed Original file line number Diff line number Diff line change @@ -1757,10 +1757,11 @@ IF(WITH_CUSTOM_LIBRARIES)
1757
1757
FILE (GLOB WITH_KERBEROS "${WITH_CUSTOM_LIBRARIES} /krb5*" )
1758
1758
FILE (GLOB WITH_SASL "${WITH_CUSTOM_LIBRARIES} /cyrus-sasl*" )
1759
1759
FILE (GLOB WITH_LDAP "${WITH_CUSTOM_LIBRARIES} /openldap*" )
1760
- FOREACH (WITH_OPT WITH_SSL WITH_KERBEROS WITH_SASL WITH_LDAP)
1760
+ FILE (GLOB WITH_CURL "${WITH_CUSTOM_LIBRARIES} /curl*" )
1761
+ FOREACH (WITH_OPT WITH_SSL WITH_KERBEROS WITH_SASL WITH_LDAP WITH_CURL)
1761
1762
IF (IS_DIRECTORY ${${WITH_OPT} })
1762
1763
SET (${WITH_OPT} ${${WITH_OPT} } CACHE INTERNAL "" FORCE)
1763
- MESSAGE (STATUS "${WITH_OPT} ${${WITH_SSL } }" )
1764
+ MESSAGE (STATUS "${WITH_OPT} ${${WITH_OPT } }" )
1764
1765
ELSE ()
1765
1766
MESSAGE (WARNING "${WITH_OPT} not found" ) # This should be FATAL_ERROR
1766
1767
ENDIF ()
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ MACRO(MYSQL_ADD_PLUGIN plugin_arg)
29
29
DEFAULT_LEGACY_ENGINE
30
30
MANDATORY # not actually a plugin, always builtin
31
31
MODULE_ONLY # build only as shared library
32
+ NO_UNDEFINED # add -Wl,--no-undefined on Linux, relevant for MODULE_ONLY
32
33
SKIP_INSTALL
33
34
STATIC_ONLY
34
35
STORAGE_ENGINE
@@ -190,13 +191,24 @@ MACRO(MYSQL_ADD_PLUGIN plugin_arg)
190
191
MY_TARGET_LINK_OPTIONS(${target}
191
192
"LINKER:--compress-debug-sections=zlib" )
192
193
ENDIF ()
193
- SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX ""
194
- COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN" )
194
+ SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "" )
195
+
196
+ # CLIENT_ONLY plugins should have no undefined symbols.
197
+ IF (ARG_CLIENT_ONLY)
198
+ SET (ARG_NO_UNDEFINED ON )
199
+ ENDIF ()
200
+
201
+ IF (ARG_NO_UNDEFINED AND LINK_FLAG_NO_UNDEFINED)
202
+ MY_TARGET_LINK_OPTIONS(${target} "${LINK_FLAG_NO_UNDEFINED} " )
203
+ ENDIF ()
204
+
195
205
IF (WIN32_CLANG AND WITH_ASAN)
196
206
TARGET_LINK_LIBRARIES (${target}
197
207
"${ASAN_LIB_DIR} /clang_rt.asan_dll_thunk-x86_64.lib" )
198
208
ENDIF ()
199
209
IF (NOT ARG_CLIENT_ONLY)
210
+ SET_TARGET_PROPERTIES (${target} PROPERTIES
211
+ COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN" )
200
212
TARGET_LINK_LIBRARIES (${target} mysqlservices)
201
213
ENDIF ()
202
214
Original file line number Diff line number Diff line change @@ -281,18 +281,11 @@ MACRO(MYSQL_CHECK_SASL_DLLS)
281
281
STRING (REPLACE ";" " " SASL_DEPENDS_ON "${SASL_DEPENDS_ON} " )
282
282
IF (NOT SASL_DEPENDS_ON MATCHES "libkrb5" )
283
283
MESSAGE (WARNING "This SASL library is built without KERBEROS" )
284
+ MESSAGE (WARNING "DEPENDENCIES are ${SASL_DEPENDS_ON} " )
285
+ # Disable KERBEROS for LDAP client authentication plugin.
284
286
SET (SASL_WITHOUT_KERBEROS 1)
285
- UNSET (KERBEROS_CUSTOM_LIBRARY CACHE )
286
- UNSET (KERBEROS_CUSTOM_LIBRARY)
287
- UNSET (KERBEROS_FOUND CACHE )
288
- UNSET (KERBEROS_FOUND)
289
- UNSET (KERBEROS_LIBRARIES CACHE )
290
- UNSET (KERBEROS_LIBRARIES)
291
287
UNSET (KERBEROS_LIB_CONFIGURED CACHE )
292
288
UNSET (KERBEROS_LIB_CONFIGURED)
293
- UNSET (KERBEROS_SYSTEM_LIBRARY CACHE )
294
- UNSET (KERBEROS_SYSTEM_LIBRARY)
295
- SET (WITH_KERBEROS "none" CACHE STRING "" FORCE)
296
289
ENDIF ()
297
290
298
291
COPY_CUSTOM_SHARED_LIBRARY("${SASL_CUSTOM_LIBRARY} " ""
Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ IF((KERBEROS_INCLUDE_DIR AND GSSAPI_INCLUDE_DIR))
51
51
SET (AUTH_CLIENT "gssapi_authentication_client.cc" )
52
52
SET (UTILITY "gssapi_utility.cc" )
53
53
SET (CORE "kerberos_core.cc" )
54
- SET (KERBEROS_LIB " ${GSSAPI_LIBRARIES} " )
55
- LIST (APPEND KERBEROS_LIB " ${KERBEROS_LIBRARIES} " )
54
+ SET (KERBEROS_LIB ${GSSAPI_LIBRARIES} )
55
+ LIST (APPEND KERBEROS_LIB ${KERBEROS_LIBRARIES} )
56
56
MESSAGE (STATUS "Using Kerberos libraries: ${KERBEROS_LIB} " )
57
57
ELSE ()
58
58
MESSAGE (WARNING
@@ -78,8 +78,6 @@ MYSQL_ADD_PLUGIN(authentication_kerberos_client
78
78
${CORE}
79
79
${UTILITY}
80
80
LINK_LIBRARIES
81
- # Uncomment to verify that all symbols are found.
82
- # ${LINK_FLAG_NO_UNDEFINED}
83
81
${KERBEROS_LIB}
84
82
${SSL_LIBRARIES}
85
83
${LIBDL}
Original file line number Diff line number Diff line change 23
23
#include " my_config.h"
24
24
25
25
/*
26
- In case of kerberos authentication we need to fill user name as kerberos user
27
- name if it is empty. We need to fill user name inside mysql->user, clients
28
- uses my_strdup directly to create new string. To use MySQL alloc functions we
29
- need to include "/mysql/service_mysql_alloc.h". Inside service_mysql_alloc.h
30
- there is #define which forces all dynamic plugins to use MySQL malloc function
31
- via services. Client side plugin cannot use any services as of now. Code
32
- check in service_mysql_alloc.h #ifdef MYSQL_DYNAMIC_PLUGIN #define my_strdup
33
- mysql_malloc_service->my_strdup #else extern char *my_strdup(PSI_memory_key
34
- key, const char *from, myf_t flags); #endif Client authentication plugin
35
- defines MYSQL_DYNAMIC_PLUGIN. And this forces to use always my_strdup via
36
- services. To use native direct my_strdup, we need to undefine
37
- MYSQL_DYNAMIC_PLUGIN. And again define MYSQL_DYNAMIC_PLUGIN once correct
38
- my_strdup are declared. service_mysql_alloc.h should provide proper fix like
39
- Instead of #ifdef MYSQL_DYNAMIC_PLUGIN
40
- #ifdef MYSQL_DYNAMIC_PLUGIN && ! MYSQL_CLIENT_PLUGIN
26
+ This is a CLIENT_ONLY plugin, so allocation functions are my_malloc,
27
+ my_free etc.
41
28
*/
42
- #undef MYSQL_DYNAMIC_PLUGIN
43
29
#include < mysql/service_mysql_alloc.h>
44
- #define MYSQL_DYNAMIC_PLUGIN
45
30
46
31
#include " auth_kerberos_client_plugin.h"
47
32
Original file line number Diff line number Diff line change @@ -54,7 +54,12 @@ ENDIF()
54
54
55
55
DISABLE_MISSING_PROFILE_WARNING()
56
56
57
- IF (KERBEROS_FOUND AND (NOT WIN32 ))
57
+ IF (SASL_WITHOUT_KERBEROS)
58
+ MESSAGE (WARNING "Bad custom SASL library" )
59
+ MESSAGE (STATUS
60
+ "Building authentication_ldap_sasl_client WITHOUT Kerberos" )
61
+ UNSET (LDAP_KERBEROS_LIBS)
62
+ ELSEIF (KERBEROS_FOUND AND (NOT WIN32 ))
58
63
MESSAGE (STATUS
59
64
"Building authentication_ldap_sasl_client with Kerberos" )
60
65
IF (KERBEROS_INCLUDE_DIR)
@@ -79,8 +84,6 @@ MYSQL_ADD_PLUGIN(authentication_ldap_sasl_client
79
84
log_client.cc
80
85
LINK_LIBRARIES
81
86
${SASL_LIBRARY}
82
- # Uncomment to verify that all symbols are found.
83
- # ${LINK_FLAG_NO_UNDEFINED}
84
87
${LDAP_KERBEROS_LIBS}
85
88
${SSL_LIBRARIES}
86
89
${LIBDL}
Original file line number Diff line number Diff line change 23
23
#include " my_config.h"
24
24
25
25
/*
26
- In case of Kerberos authentication we need to fill user name as Kerberos user
27
- name if it is empty. We need to fill user name inside mysql->user, clients
28
- uses my_strdup directly to create new string. To use MySQL alloc functions we
29
- need to include "/mysql/service_mysql_alloc.h". Inside service_mysql_alloc.h
30
- there is #define which forces all dynamic plugins to use MySQL malloc function
31
- via services. Client side plugin cannot use any services as of now. Code
32
- check in service_mysql_alloc.h #ifdef MYSQL_DYNAMIC_PLUGIN #define my_strdup
33
- mysql_malloc_service->my_strdup #else extern char *my_strdup(PSI_memory_key
34
- key, const char *from, myf_t flags); #endif Client authentication plugin
35
- defines MYSQL_DYNAMIC_PLUGIN. And this forces to use always my_strdup via
36
- services. To use native direct my_strdup, we need to undefine
37
- MYSQL_DYNAMIC_PLUGIN. And again define MYSQL_DYNAMIC_PLUGIN once correct
38
- my_strdup are declared. service_mysql_alloc.h should provide proper fix like
39
- Instead of #ifdef MYSQL_DYNAMIC_PLUGIN
40
- #ifdef MYSQL_DYNAMIC_PLUGIN && ! MYSQL_CLIENT_PLUGIN
26
+ This is a CLIENT_ONLY plugin, so allocation functions are my_malloc,
27
+ my_free etc.
41
28
*/
42
29
#if defined(KERBEROS_LIB_CONFIGURED)
43
- #undef MYSQL_DYNAMIC_PLUGIN
44
30
#include < mysql/service_mysql_alloc.h>
45
- #define MYSQL_DYNAMIC_PLUGIN
46
31
#endif
47
32
48
33
#include < stdio.h>
You can’t perform that action at this time.
0 commit comments