Skip to content

Commit

Permalink
Use HAVE_SASL_CB_GETCONFPATH
Browse files Browse the repository at this point in the history
With SASL_CB_GETCONFPATH detection added, HAVE_SASL_CB_GETCONFPATH can be used.
For memcached/memcached#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".
  • Loading branch information
thatsafunnyname authored and dormando committed Mar 23, 2018
1 parent 39151c8 commit 7f2c52d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sasl_defs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 7f2c52d

Please sign in to comment.