diff options
-rw-r--r-- | cmake/install_macros.cmake | 9 | ||||
-rw-r--r-- | cmake/plugin.cmake | 29 | ||||
-rw-r--r-- | plugin/auth_dialog/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugin/auth_examples/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugin/auth_gssapi/CMakeLists.txt | 5 | ||||
-rw-r--r-- | plugin/auth_gssapi/README.md | 4 | ||||
-rw-r--r-- | plugin/auth_gssapi/client_plugin.cc | 2 | ||||
-rw-r--r-- | plugin/auth_gssapi/cmake/FindGSSAPI.cmake | 24 | ||||
-rw-r--r-- | plugin/auth_gssapi/gssapi_errmsg.cc | 2 | ||||
-rw-r--r-- | plugin/auth_gssapi/gssapi_errmsg.h | 2 | ||||
-rw-r--r-- | plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm | 8 | ||||
-rw-r--r-- | plugin/auth_gssapi/server_plugin.cc | 16 | ||||
-rw-r--r-- | plugin/auth_gssapi/server_plugin.h | 2 | ||||
-rw-r--r-- | plugin/auth_gssapi/sspi.h | 2 | ||||
-rw-r--r-- | plugin/auth_gssapi/sspi_client.cc | 2 | ||||
-rw-r--r-- | plugin/auth_gssapi/sspi_errmsg.cc | 2 | ||||
-rw-r--r-- | plugin/auth_gssapi/sspi_server.cc | 2 | ||||
-rw-r--r-- | win/packaging/CPackWixConfig.cmake | 21 |
18 files changed, 83 insertions, 53 deletions
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index 2680d9ccbb4..00edcc737ce 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -44,11 +44,10 @@ FUNCTION (INSTALL_DEBUG_SYMBOLS) ENDIF() set(comp "") - IF(ARG_COMPONENT STREQUAL "Server") - IF(target MATCHES "mysqld" OR type MATCHES "MODULE") - #MESSAGE("PDB: ${targets}") - SET(comp Server) - ENDIF() + + IF(target MATCHES "mysqld" OR type MATCHES "MODULE") + #MESSAGE("PDB: ${targets}") + SET(comp Server) ENDIF() IF(NOT comp MATCHES Server) diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 9d24dacc7e1..95cf9e2cd6e 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -19,6 +19,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) # MYSQL_ADD_PLUGIN(plugin_name source1...sourceN # [STORAGE_ENGINE] +# [CLIENT] # [MANDATORY|DEFAULT] # [STATIC_ONLY|DYNAMIC_ONLY] # [MODULE_OUTPUT_NAME module_name] @@ -30,7 +31,7 @@ INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) MACRO(MYSQL_ADD_PLUGIN) MYSQL_PARSE_ARGUMENTS(ARG "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG" - "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED" + "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT" ${ARGN} ) @@ -120,7 +121,7 @@ MACRO(MYSQL_ADD_PLUGIN) # Build either static library or module IF (PLUGIN_${plugin} MATCHES "(STATIC|AUTO|YES)" AND NOT ARG_MODULE_ONLY - AND NOT ARG_DISABLED) + AND NOT ARG_DISABLED AND NOT ARG_CLIENT) IF(CMAKE_GENERATOR MATCHES "Makefiles|Ninja") # If there is a shared library from previous shared build, @@ -188,14 +189,14 @@ MACRO(MYSQL_ADD_PLUGIN) TARGET_LINK_LIBRARIES (${target} mysqlservices ${ARG_LINK_LIBRARIES}) - # Plugin uses symbols defined in mysqld executable. + # Server plugins use symbols defined in mysqld executable. # Some operating systems like Windows and OSX and are pretty strict about # unresolved symbols. Others are less strict and allow unresolved symbols # in shared libraries. On Linux for example, CMake does not even add # executable to the linker command line (it would result into link error). # Thus we skip TARGET_LINK_LIBRARIES on Linux, as it would only generate # an additional dependency. - IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") + IF(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ARG_CLIENT) TARGET_LINK_LIBRARIES (${target} mysqld) ENDIF() ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES}) @@ -206,19 +207,21 @@ MACRO(MYSQL_ADD_PLUGIN) IF(ARG_COMPONENT) IF(CPACK_COMPONENTS_ALL AND NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT}) - SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT} PARENT_SCOPE) - SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE) - - IF (NOT ARG_CONFIG) - SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf") - FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n") - ENDIF() - INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR}) + SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT}) + SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE) + SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE) + # workarounds for cmake issues #13248 and #12864: SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_OBSOLETES "cmake_bug_13248" PARENT_SCOPE) - SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE) + + IF(NOT ARG_CLIENT AND NOT ARG_CONFIG AND UNIX) + SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${target}.cnf") + FILE(WRITE ${ARG_CONFIG} "[mariadb]\nplugin-load-add=${ARG_MODULE_OUTPUT_NAME}.so\n") + INSTALL(FILES ${ARG_CONFIG} COMPONENT ${ARG_COMPONENT} DESTINATION ${INSTALL_SYSCONF2DIR}) + SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE) + ENDIF() ENDIF() ELSE() SET(ARG_COMPONENT Server) diff --git a/plugin/auth_dialog/CMakeLists.txt b/plugin/auth_dialog/CMakeLists.txt index a23518060be..7253b2b2f97 100644 --- a/plugin/auth_dialog/CMakeLists.txt +++ b/plugin/auth_dialog/CMakeLists.txt @@ -15,4 +15,4 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA MYSQL_ADD_PLUGIN(dialog dialog.c ${CMAKE_SOURCE_DIR}/libmysql/get_password.c - MODULE_ONLY COMPONENT ClientPlugins) + MODULE_ONLY CLIENT COMPONENT ClientPlugins) diff --git a/plugin/auth_examples/CMakeLists.txt b/plugin/auth_examples/CMakeLists.txt index c7b7e5be62d..d1152227eff 100644 --- a/plugin/auth_examples/CMakeLists.txt +++ b/plugin/auth_examples/CMakeLists.txt @@ -30,4 +30,4 @@ MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c MYSQL_ADD_PLUGIN(auth_0x0100 auth_0x0100.c MODULE_ONLY COMPONENT Test) MYSQL_ADD_PLUGIN(mysql_clear_password clear_password_client.c - MODULE_ONLY COMPONENT ClientPlugins) + MODULE_ONLY CLIENT COMPONENT ClientPlugins) diff --git a/plugin/auth_gssapi/CMakeLists.txt b/plugin/auth_gssapi/CMakeLists.txt index 61649e4845a..f85d0deaea1 100644 --- a/plugin/auth_gssapi/CMakeLists.txt +++ b/plugin/auth_gssapi/CMakeLists.txt @@ -25,9 +25,12 @@ ENDIF () MYSQL_ADD_PLUGIN(auth_gssapi server_plugin.cc ${GSSAPI_SERVER} ${GSSAPI_ERRMSG} - LINK_LIBRARIES ${GSSAPI_LIBS} + LINK_LIBRARIES ${GSSAPI_LIBS} + COMPONENT gssapi-server MODULE_ONLY) MYSQL_ADD_PLUGIN(auth_gssapi_client client_plugin.cc ${GSSAPI_CLIENT} ${GSSAPI_ERRMSG} LINK_LIBRARIES ${GSSAPI_LIBS} + COMPONENT gssapi-client + CLIENT MODULE_ONLY) diff --git a/plugin/auth_gssapi/README.md b/plugin/auth_gssapi/README.md index f20128f1551..7f678400f0d 100644 --- a/plugin/auth_gssapi/README.md +++ b/plugin/auth_gssapi/README.md @@ -11,7 +11,7 @@ environment. ## Server-side preparations on Unix To use the plugin, some preparation need to be done on the server side on Unixes. -MariaDB server will read need access to the Kerberos keytab file, that contains service principal name for the MariaDB server. +MariaDB server will need read access to the Kerberos keytab file, that contains service principal name for the MariaDB server. If you are using **Unix Kerberos KDC (MIT,Heimdal)** @@ -91,7 +91,7 @@ You may also use alternative *short* form of CREATE USER CREATE USER usr1 IDENTIFIED WITH gssapi; ``` -If this syntax is used, realm part is used for comparison +If this syntax is used, realm part is *not* used for comparison thus 'usr1@EXAMPLE.COM', 'usr1@EXAMPLE.CO.UK' and 'mymachine\usr1' will all identify as 'usr1'. #Login as GSSAPI user with command line clients diff --git a/plugin/auth_gssapi/client_plugin.cc b/plugin/auth_gssapi/client_plugin.cc index aac80e04f92..0ab619a08e6 100644 --- a/plugin/auth_gssapi/client_plugin.cc +++ b/plugin/auth_gssapi/client_plugin.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. diff --git a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake index faee4289722..78111fc2368 100644 --- a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake +++ b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake @@ -8,8 +8,28 @@ # Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it> # -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if(GSSAPI_LIBS AND GSSAPI_FLAVOR) diff --git a/plugin/auth_gssapi/gssapi_errmsg.cc b/plugin/auth_gssapi/gssapi_errmsg.cc index 29adf607503..8ea4cab5b02 100644 --- a/plugin/auth_gssapi/gssapi_errmsg.cc +++ b/plugin/auth_gssapi/gssapi_errmsg.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. diff --git a/plugin/auth_gssapi/gssapi_errmsg.h b/plugin/auth_gssapi/gssapi_errmsg.h index 786b2f6c0f9..26db8439e04 100644 --- a/plugin/auth_gssapi/gssapi_errmsg.h +++ b/plugin/auth_gssapi/gssapi_errmsg.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. diff --git a/plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm b/plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm index 3ffc6f1d696..50137ca0211 100644 --- a/plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm +++ b/plugin/auth_gssapi/mysql-test/auth_gssapi/suite.pm @@ -36,11 +36,13 @@ if (!$ENV{'GSSAPI_FULLNAME'} || !$ENV{'GSSAPI_SHORTNAME'}) return "Environment variable GSSAPI_SHORTNAME and GSSAPI_FULLNAME need to be set" } -foreach $var ('GSSAPI_SHORTNAME','GSSAPI_FULLNAME','GSSAPI_KEYTAB_PATH','GSSAPI_PRINCIPAL_NAME') +if ($::opt_verbose) { - print "$var=$ENV{$var}\n"; + foreach $var ('GSSAPI_SHORTNAME','GSSAPI_FULLNAME','GSSAPI_KEYTAB_PATH','GSSAPI_PRINCIPAL_NAME') + { + print "$var=$ENV{$var}\n"; + } } - sub is_default { 1 } bless { }; diff --git a/plugin/auth_gssapi/server_plugin.cc b/plugin/auth_gssapi/server_plugin.cc index 64f52a332fc..a79074abe79 100644 --- a/plugin/auth_gssapi/server_plugin.cc +++ b/plugin/auth_gssapi/server_plugin.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. @@ -59,6 +59,14 @@ static int gssapi_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *auth_info) const char *user; int user_len; + /* No user name yet ? Read the client handshake packet with the user name. */ + if (auth_info->user_name == 0) + { + unsigned char *pkt; + if (vio->read_packet(vio, &pkt) < 0) + return CR_ERROR; + } + /* Send first packet with target name and mech name */ if (vio->write_packet(vio, (unsigned char *)first_packet, first_packet_len)) { @@ -106,7 +114,7 @@ static int deinitialize_plugin(void *unused) /* system variable */ static MYSQL_SYSVAR_STR(keytab_path, srv_keytab_path, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, - "Keytab file path (Kerberos)", + "Keytab file path for Kerberos authentication", NULL, NULL, ""); @@ -131,7 +139,7 @@ static TYPELIB mech_name_typelib = { }; static MYSQL_SYSVAR_ENUM(mech_name, srv_mech, PLUGIN_VAR_RQCMDARG|PLUGIN_VAR_READONLY, - "GSSAPI mechanism : either Kerberos or Negotiate", + "GSSAPI mechanism", NULL, NULL, 2,&mech_name_typelib); @@ -169,7 +177,7 @@ maria_declare_plugin(gssapi_server) NULL, /* status variables */ system_variables, /* system variables */ "1.0", - MariaDB_PLUGIN_MATURITY_EXPERIMENTAL + MariaDB_PLUGIN_MATURITY_BETA } maria_declare_plugin_end; diff --git a/plugin/auth_gssapi/server_plugin.h b/plugin/auth_gssapi/server_plugin.h index 6f1a2fc7d54..1348835e653 100644 --- a/plugin/auth_gssapi/server_plugin.h +++ b/plugin/auth_gssapi/server_plugin.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. diff --git a/plugin/auth_gssapi/sspi.h b/plugin/auth_gssapi/sspi.h index ceb668750af..34b8a56a32e 100644 --- a/plugin/auth_gssapi/sspi.h +++ b/plugin/auth_gssapi/sspi.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. diff --git a/plugin/auth_gssapi/sspi_client.cc b/plugin/auth_gssapi/sspi_client.cc index 4946a0f4a98..34c1ce2e7ee 100644 --- a/plugin/auth_gssapi/sspi_client.cc +++ b/plugin/auth_gssapi/sspi_client.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. diff --git a/plugin/auth_gssapi/sspi_errmsg.cc b/plugin/auth_gssapi/sspi_errmsg.cc index 8c3eb99ed6b..961ef51f42e 100644 --- a/plugin/auth_gssapi/sspi_errmsg.cc +++ b/plugin/auth_gssapi/sspi_errmsg.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. diff --git a/plugin/auth_gssapi/sspi_server.cc b/plugin/auth_gssapi/sspi_server.cc index 1d51a66c3d8..1dfd2986aaa 100644 --- a/plugin/auth_gssapi/sspi_server.cc +++ b/plugin/auth_gssapi/sspi_server.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, Shuang Qiu, Robbie Hardwood, +/* Copyright (c) 2015, Shuang Qiu, Robbie Harwood, Vladislav Vaintroub & MariaDB Corporation All rights reserved. diff --git a/win/packaging/CPackWixConfig.cmake b/win/packaging/CPackWixConfig.cmake index 58a2ef44eef..af2cb1af802 100644 --- a/win/packaging/CPackWixConfig.cmake +++ b/win/packaging/CPackWixConfig.cmake @@ -9,7 +9,7 @@ IF(ESSENTIALS) ENDIF() ELSE() SET(CPACK_COMPONENTS_USED - "Server;Client;Development;SharedLibraries;Embedded;Documentation;IniFiles;Readme;Debuginfo;Common;connect-engine") + "Server;Client;Development;SharedLibraries;Embedded;Documentation;IniFiles;Readme;Debuginfo;Common;connect-engine;ClientPlugins;gssapi-server;gssapi-client") ENDIF() SET( WIX_FEATURE_MySQLServer_EXTRA_FEATURES "DBInstance;SharedClientServerComponents") @@ -54,20 +54,15 @@ SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install server") SET(CPACK_COMPONENT_DEBUGBINARIES_DESCRIPTION "Debug/trace versions of executables and libraries" ) #SET(CPACK_COMPONENT_DEBUGBINARIES_WIX_LEVEL 2) - - - #Subfeature "Data Files" - SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer") - SET(CPACK_COMPONENT_DATAFILES_DISPLAY_NAME "Server data files") - SET(CPACK_COMPONENT_DATAFILES_DESCRIPTION "Server data files" ) - SET(CPACK_COMPONENT_DATAFILES_HIDDEN 1) - #Subfeature "Connect Engine" - SET(CPACK_COMPONENT_CONNECT-ENGINE_GROUP "MySQLServer") - SET(CPACK_COMPONENT_CONNECT-ENGINE_DISPLAY_NAME "Server data files") - SET(CPACK_COMPONENT_CONNECT-ENGINE_DESCRIPTION "Server data files" ) - SET(CPACK_COMPONENT_CONNECT-ENGINE_HIDDEN 1) + #Miscellaneous (hidden) components, part of server / or client programs + FOREACH(comp connect-engine ClientPlugins gssapi-server gssapi-client) + STRING(TOUPPER "${comp}" comp) + SET(CPACK_COMPONENT_${comp}_GROUP "MySQLServer") + SET(CPACK_COMPONENT_${comp}_HIDDEN 1) + ENDFOREACH() + #Feature "Devel" SET(CPACK_COMPONENT_GROUP_DEVEL_DISPLAY_NAME "Development Components") SET(CPACK_COMPONENT_GROUP_DEVEL_DESCRIPTION "Installs C/C++ header files and libraries") |