diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2016-02-16 12:55:45 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2016-02-16 12:55:45 +0000 |
commit | 1ac64b7510fd006268936e46442f46a28250c249 (patch) | |
tree | 4399526b678a8bcbe9dae9c2808a6da0ebf64b19 | |
parent | d80b8442a68093106e00a9a38b7b2c593002a72c (diff) | |
download | mariadb-git-1ac64b7510fd006268936e46442f46a28250c249.tar.gz |
MDEV-9557 - fix compilation errors due to missing krb5_free_unparsed_name() in old versions of Heimdal Kerberos
-rw-r--r-- | plugin/auth_gssapi/CMakeLists.txt | 9 | ||||
-rw-r--r-- | plugin/auth_gssapi/cmake/FindGSSAPI.cmake | 4 | ||||
-rw-r--r-- | plugin/auth_gssapi/gssapi_server.cc | 3 |
3 files changed, 14 insertions, 2 deletions
diff --git a/plugin/auth_gssapi/CMakeLists.txt b/plugin/auth_gssapi/CMakeLists.txt index f85d0deaea1..7d9e58e165f 100644 --- a/plugin/auth_gssapi/CMakeLists.txt +++ b/plugin/auth_gssapi/CMakeLists.txt @@ -17,6 +17,15 @@ ELSE() SET(GSSAPI_CLIENT gssapi_client.cc) SET(GSSAPI_SERVER gssapi_server.cc) SET(GSSAPI_ERRMSG gssapi_errmsg.cc) + + SET(CMAKE_REQUIRED_INCLUDES ${GSSAPI_INCS}) + SET(CMAKE_REQUIRED_LIBRARIES ${GSSAPI_LIBS}) + INCLUDE(CheckCXXSymbolExists) + CHECK_CXX_SYMBOL_EXISTS(krb5_free_unparsed_name "krb5.h" HAVE_KRB5_FREE_UNPARSED_NAME) + IF(HAVE_KRB5_FREE_UNPARSED_NAME) + ADD_DEFINITIONS(-DHAVE_KRB5_FREE_UNPARSED_NAME=1) + ENDIF() + ELSE() # Can't build plugin RETURN() diff --git a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake index 78111fc2368..cc8e62d1ca7 100644 --- a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake +++ b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake @@ -39,7 +39,7 @@ if(GSSAPI_LIBS AND GSSAPI_FLAVOR) else(GSSAPI_LIBS AND GSSAPI_FLAVOR) - find_program(KRB5_CONFIG NAMES krb5-config PATHS + find_program(KRB5_CONFIG NAMES krb5-config heimdal-krb5-config PATHS /opt/local/bin ONLY_CMAKE_FIND_ROOT_PATH # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex ) @@ -95,4 +95,4 @@ else(GSSAPI_LIBS AND GSSAPI_FLAVOR) endif(KRB5_CONFIG) -endif(GSSAPI_LIBS AND GSSAPI_FLAVOR)
\ No newline at end of file +endif(GSSAPI_LIBS AND GSSAPI_FLAVOR) diff --git a/plugin/auth_gssapi/gssapi_server.cc b/plugin/auth_gssapi/gssapi_server.cc index ed042a026b1..ac75a4f1593 100644 --- a/plugin/auth_gssapi/gssapi_server.cc +++ b/plugin/auth_gssapi/gssapi_server.cc @@ -31,6 +31,9 @@ static void log_error( OM_uint32 major, OM_uint32 minor, const char *msg) Generate default principal service name formatted as principal name "mariadb/server.fqdn@REALM" */ #include <krb5.h> +#ifndef HAVE_KRB5_FREE_UNPARSED_NAME +#define krb5_free_unparsed_name(a,b) krb5_xfree(b) +#endif static char* get_default_principal_name() { static char default_name[1024]; |