From 7f2c52d38c35d7b7a9a408bc706fddbaa3540f36 Mon Sep 17 00:00:00 2001 From: "Peter (Stig) Edwards" Date: Thu, 22 Mar 2018 10:14:39 +0000 Subject: Use HAVE_SASL_CB_GETCONFPATH With SASL_CB_GETCONFPATH detection added, HAVE_SASL_CB_GETCONFPATH can be used. For https://github.com/memcached/memcached/issues/365 On RHEL(5|6|7) the name of the defined constant in sasl.h is SASL_CB_GETCONFPATH and not SASL_CB_GETCONF. This is used when ./configure is run with "--enable-sasl". --- sasl_defs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sasl_defs.c') diff --git a/sasl_defs.c b/sasl_defs.c index 93a7b8b..c60d1bf 100644 --- a/sasl_defs.c +++ b/sasl_defs.c @@ -7,7 +7,7 @@ char my_sasl_hostname[1025]; -#ifdef HAVE_SASL_CB_GETCONF +#if defined(HAVE_SASL_CB_GETCONF) || defined(HAVE_SASL_CB_GETCONFPATH) /* The locations we may search for a SASL config file if the user didn't * specify one in the environment variable SASL_CONF_PATH */ @@ -82,7 +82,7 @@ static int sasl_server_userdb_checkpass(sasl_conn_t *conn, } #endif -#ifdef HAVE_SASL_CB_GETCONF +#if defined(HAVE_SASL_CB_GETCONF) || defined(HAVE_SASL_CB_GETCONFPATH) static int sasl_getconf(void *context, const char **path) { *path = getenv("SASL_CONF_PATH"); @@ -152,6 +152,10 @@ static sasl_callback_t sasl_callbacks[] = { #ifdef HAVE_SASL_CB_GETCONF { SASL_CB_GETCONF, sasl_getconf, NULL }, +#else +#ifdef HAVE_SASL_CB_GETCONFPATH + { SASL_CB_GETCONFPATH, (sasl_callback_ft)sasl_getconf, NULL }, +#endif #endif { SASL_CB_LIST_END, NULL, NULL } -- cgit v1.2.1