Skip to content

Commit 67cf76a

Browse files
committed
MDEV 4691- address review comments
1 parent 059c0c8 commit 67cf76a

File tree

18 files changed

+83
-53
lines changed

18 files changed

+83
-53
lines changed

cmake/install_macros.cmake

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS)
4444
ENDIF()
4545

4646
set(comp "")
47-
IF(ARG_COMPONENT STREQUAL "Server")
48-
IF(target MATCHES "mysqld" OR type MATCHES "MODULE")
49-
#MESSAGE("PDB: ${targets}")
50-
SET(comp Server)
51-
ENDIF()
47+
48+
IF(target MATCHES "mysqld" OR type MATCHES "MODULE")
49+
#MESSAGE("PDB: ${targets}")
50+
SET(comp Server)
5251
ENDIF()
5352

5453
IF(NOT comp MATCHES Server)

cmake/plugin.cmake

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
1919

2020
# MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
2121
# [STORAGE_ENGINE]
22+
# [CLIENT]
2223
# [MANDATORY|DEFAULT]
2324
# [STATIC_ONLY|DYNAMIC_ONLY]
2425
# [MODULE_OUTPUT_NAME module_name]
@@ -30,7 +31,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
3031
MACRO(MYSQL_ADD_PLUGIN)
3132
MYSQL_PARSE_ARGUMENTS(ARG
3233
"LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
33-
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
34+
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT"
3435
${ARGN}
3536
)
3637

@@ -120,7 +121,7 @@ MACRO(MYSQL_ADD_PLUGIN)
120121

121122
# Build either static library or module
122123
IF (PLUGIN_${plugin} MATCHES "(STATIC|AUTO|YES)" AND NOT ARG_MODULE_ONLY
123-
AND NOT ARG_DISABLED)
124+
AND NOT ARG_DISABLED AND NOT ARG_CLIENT)
124125

125126
IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja")
126127
# If there is a shared library from previous shared build,
@@ -188,14 +189,14 @@ MACRO(MYSQL_ADD_PLUGIN)
188189

189190
TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES})
190191

191-
# Plugin uses symbols defined in mysqld executable.
192+
# Server plugins use symbols defined in mysqld executable.
192193
# Some operating systems like Windows and OSX and are pretty strict about
193194
# unresolved symbols. Others are less strict and allow unresolved symbols
194195
# in shared libraries. On Linux for example, CMake does not even add
195196
# executable to the linker command line (it would result into link error).
196197
# Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate
197198
# an additional dependency.
198-
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
199+
IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ARG_CLIENT)
199200
TARGET_LINK_LIBRARIES (${target} mysqld)
200201
ENDIF()
201202
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
@@ -206,19 +207,21 @@ MACRO(MYSQL_ADD_PLUGIN)
206207
IF(ARG_COMPONENT)
207208
IF(CPACK_COMPONENTS_ALL AND
208209
NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT})
209-
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT} PARENT_SCOPE)
210-
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE)
211-
212-
IF (NOT ARG_CONFIG)
213-
SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf")
214-
FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n")
215-
ENDIF()
216-
INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR})
217210

211+
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT})
212+
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
213+
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE)
214+
218215
# workarounds for cmake issues #13248 and #12864:
219216
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE)
220217
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE)
221-
SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE)
218+
219+
IF(NOT ARG_CLIENT AND NOT ARG_CONFIG AND UNIX)
220+
SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf")
221+
FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n")
222+
INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR})
223+
SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE)
224+
ENDIF()
222225
ENDIF()
223226
ELSE()
224227
SET(ARG_COMPONENT Server)

plugin/auth_dialog/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1616

1717
MYSQL_ADD_PLUGIN(dialog dialog.c ${CMAKE_SOURCE_DIR}/libmysql/get_password.c
18-
MODULE_ONLY COMPONENT ClientPlugins)
18+
MODULE_ONLY CLIENT COMPONENT ClientPlugins)

plugin/auth_examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c
3030
MYSQL_ADD_PLUGIN(auth_0x0100 auth_0x0100.c MODULE_ONLY COMPONENT Test)
3131

3232
MYSQL_ADD_PLUGIN(mysql_clear_password clear_password_client.c
33-
MODULE_ONLY COMPONENT ClientPlugins)
33+
MODULE_ONLY CLIENT COMPONENT ClientPlugins)

plugin/auth_gssapi/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ ENDIF ()
2525

2626

2727
MYSQL_ADD_PLUGIN(auth_gssapi server_plugin.cc ${GSSAPI_SERVER} ${GSSAPI_ERRMSG}
28-
LINK_LIBRARIES ${GSSAPI_LIBS}
28+
LINK_LIBRARIES ${GSSAPI_LIBS}
29+
COMPONENT gssapi-server
2930
MODULE_ONLY)
3031

3132
MYSQL_ADD_PLUGIN(auth_gssapi_client client_plugin.cc ${GSSAPI_CLIENT} ${GSSAPI_ERRMSG}
3233
LINK_LIBRARIES ${GSSAPI_LIBS}
34+
COMPONENT gssapi-client
35+
CLIENT
3336
MODULE_ONLY)

plugin/auth_gssapi/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ environment.
1111

1212
## Server-side preparations on Unix
1313
To use the plugin, some preparation need to be done on the server side on Unixes.
14-
MariaDB server will read need access to the Kerberos keytab file, that contains service principal name for the MariaDB server.
14+
MariaDB server will need read access to the Kerberos keytab file, that contains service principal name for the MariaDB server.
1515

1616

1717
If you are using **Unix Kerberos KDC (MIT,Heimdal)**
@@ -91,7 +91,7 @@ You may also use alternative *short* form of CREATE USER
9191
CREATE USER usr1 IDENTIFIED WITH gssapi;
9292
```
9393

94-
If this syntax is used, realm part is used for comparison
94+
If this syntax is used, realm part is *not* used for comparison
9595
thus 'usr1@EXAMPLE.COM', 'usr1@EXAMPLE.CO.UK' and 'mymachine\usr1' will all identify as 'usr1'.
9696

9797
#Login as GSSAPI user with command line clients

plugin/auth_gssapi/client_plugin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood,
1+
/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood,
22
Vladislav Vaintroub & MariaDB Corporation
33
44
All rights reserved.

plugin/auth_gssapi/cmake/FindGSSAPI.cmake

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,28 @@
88

99
# Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
1010
#
11-
# Redistribution and use is allowed according to the terms of the BSD license.
12-
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
11+
# Redistribution and use in source and binary forms, with or without
12+
# modification, are permitted provided that the following conditions
13+
# are met:
14+
#
15+
# 1. Redistributions of source code must retain the copyright
16+
# notice, this list of conditions and the following disclaimer.
17+
# 2. Redistributions in binary form must reproduce the copyright
18+
# notice, this list of conditions and the following disclaimer in the
19+
# documentation and/or other materials provided with the distribution.
20+
# 3. The name of the author may not be used to endorse or promote products
21+
# derived from this software without specific prior written permission.
22+
#
23+
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24+
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25+
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26+
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28+
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32+
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1333

1434

1535
if(GSSAPI_LIBS AND GSSAPI_FLAVOR)

plugin/auth_gssapi/gssapi_errmsg.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood,
1+
/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood,
22
Vladislav Vaintroub & MariaDB Corporation
33
44
All rights reserved.

plugin/auth_gssapi/gssapi_errmsg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood,
1+
/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood,
22
Vladislav Vaintroub & MariaDB Corporation
33
44
All rights reserved.

0 commit comments

Comments
 (0)