Skip to content

Commit

Permalink
Check if module was built as threadsafe but library now claims not to be
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Feb 4, 2014
1 parent 9855362 commit 0d281af
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/modules/rlm_krb5/rlm_krb5.c
Expand Up @@ -82,15 +82,32 @@ static int krb5_instantiate(CONF_SECTION *conf, void *instance)
DEBUG("Using MIT Kerberos library");
#endif

#ifndef KRB5_IS_THREAD_SAFE
if (!krb5_is_thread_safe()) {
WDEBUG("libkrb5 is not threadsafe, recompile it, and the server with thread support enabled");
/*
* rlm_krb5 was built as threadsafe
*/
#ifdef KRB5_IS_THREAD_SAFE
ERROR("Build time libkrb5 was threadsafe, but run time library claims not to be");
ERROR("Modify runtime linker path (LD_LIBRARY_PATH on most systems), to prefer threadsafe libkrb5");
return -1;
/*
* rlm_krb5 was not built as threadsafe
*/
#else
WDEBUG("libkrb5 is not threadsafe, recompile it with thread support enabled ("
# ifdef HEIMDAL_KRB5
"--enable-pthread-support"
# else
"--disable-thread-support=no"
# endif
")");
WDEBUG("rlm_krb5 will run in single threaded mode, performance may be degraded");
} else {
WDEBUG("Build time libkrb5 was not threadsafe, but run time library claims to be");
WDEBUG("Reconfigure and recompile rlm_krb5 to enable thread support");
}
#endif
}

inst->xlat_name = cf_section_name2(conf);
if (!inst->xlat_name) {
inst->xlat_name = cf_section_name1(conf);
Expand Down

0 comments on commit 0d281af

Please sign in to comment.