MDEV-9557 - fix compilation errors due to missing krb5_free_unparsed_name() in old versions of Heimdal Kerberos

This commit is contained in:
Vladislav Vaintroub 2016-02-16 12:55:45 +00:00
parent d80b8442a6
commit 1ac64b7510
3 changed files with 14 additions and 2 deletions

View File

@ -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()

View File

@ -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)
endif(GSSAPI_LIBS AND GSSAPI_FLAVOR)

View File

@ -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];