summaryrefslogtreecommitdiff
path: root/sasl_defs.c
diff options
context:
space:
mode:
authorPeter (Stig) Edwards <thatsafunnyname@gmail.com>2018-03-22 10:14:39 +0000
committerdormando <dormando@rydia.net>2018-03-23 11:11:41 -0700
commit7f2c52d38c35d7b7a9a408bc706fddbaa3540f36 (patch)
tree7b04c6754c109c130726dc1796f3aa8972786ab6 /sasl_defs.c
parent39151c870c5e598f039714bdb790bd46f614856e (diff)
downloadmemcached-7f2c52d38c35d7b7a9a408bc706fddbaa3540f36.tar.gz
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".
Diffstat (limited to 'sasl_defs.c')
-rw-r--r--sasl_defs.c8
1 files changed, 6 insertions, 2 deletions
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 }