ldap_set_option(NULL, LDAP_X_OPT_CONNECT_TIMEOUT, &local_timelimit);
#endif
- HNDL_LOCK(ldap_context);
+ st = HNDL_LOCK(ldap_context);
+ if (st)
+ return st;
while (ldap_context->server_info_list[cnt] != NULL) {
krb5_ldap_server_info *server_info=NULL;
*ldap_server_handle = NULL;
- HNDL_LOCK(ldap_context);
+ st = HNDL_LOCK(ldap_context);
+ if (st)
+ return st;
if (((*ldap_server_handle)=krb5_get_ldap_handle(ldap_context)) == NULL)
(*ldap_server_handle)=krb5_retry_get_ldap_handle(ldap_context, &st);
HNDL_UNLOCK(ldap_context);
{
krb5_error_code st=0;
- HNDL_LOCK(ldap_context);
+ st = HNDL_LOCK(ldap_context);
+ if (st)
+ return st;
(*ldap_server_handle)->server_info->server_status = OFF;
time(&(*ldap_server_handle)->server_info->downtime);
krb5_put_ldap_handle(*ldap_server_handle);
krb5_ldap_context *ldap_context;
krb5_ldap_server_handle *ldap_server_handle;
{
-
if (ldap_server_handle != NULL) {
- HNDL_LOCK(ldap_context);
- krb5_put_ldap_handle(ldap_server_handle);
- HNDL_UNLOCK(ldap_context);
+ if (HNDL_LOCK(ldap_context) == 0) {
+ krb5_put_ldap_handle(ldap_server_handle);
+ HNDL_UNLOCK(ldap_context);
+ }
}
return;
}
ep->msg = NULL;
return ep->scratch_buf;
}
- lock();
+ if (lock())
+ goto no_fptr;
if (fptr == NULL) {
unlock();
+ no_fptr:
#ifdef HAVE_STRERROR_R
if (strerror_r (code, ep->scratch_buf, sizeof(ep->scratch_buf)) == 0) {
char *p = strdup(ep->scratch_buf);
krb5int_set_error_info_callout_fn (const char *(KRB5_CALLCONV *f)(long))
{
initialize();
- lock();
- fptr = f;
- unlock();
+ if (lock() == 0) {
+ fptr = f;
+ unlock();
+ }
}