Commit 16b7df83 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

ITS#6625 Remove some LDAP_R_COMPILEs

parent 5ecd624f
......@@ -664,9 +664,7 @@ ldap_int_gss_spnego_bind_s( LDAP *ld )
gss_buffer_desc input_token, output_token = GSS_C_EMPTY_BUFFER;
struct berval cred, *scred = NULL;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &ldap_int_gssapi_mutex );
#endif
LDAP_MUTEX_LOCK( &ldap_int_gssapi_mutex );
/* get information from RootDSE entry */
rc = ldap_gssapi_get_rootdse_infos ( ld, &mechlist,
......@@ -784,9 +782,7 @@ gss_error:
(ret_mech != GSS_C_NO_OID ? ret_mech : req_mech ),
gss_rc, minor_status );
rc_error:
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &ldap_int_gssapi_mutex );
#endif
LDAP_MUTEX_UNLOCK( &ldap_int_gssapi_mutex );
LDAP_FREE( mechlist );
LDAP_FREE( ldapServiceName );
LDAP_FREE( dnsHostName );
......
......@@ -37,10 +37,6 @@
#include "ldap-tls.h"
#ifdef LDAP_R_COMPILE
#include <ldap_pvt_thread.h>
#endif
static tls_impl *tls_imp = &ldap_int_tls_impl;
#define HAS_TLS( sb ) ber_sockbuf_ctrl( sb, LBER_SB_OPT_HAS_IO, \
(void *)tls_imp->ti_sbio )
......@@ -269,13 +265,9 @@ ldap_pvt_tls_init_def_ctx( int is_server )
{
struct ldapoptions *lo = LDAP_INT_GLOBAL_OPT();
int rc;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &tls_def_ctx_mutex );
#endif
LDAP_MUTEX_LOCK( &tls_def_ctx_mutex );
rc = ldap_int_tls_init_ctx( lo, is_server );
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &tls_def_ctx_mutex );
#endif
LDAP_MUTEX_UNLOCK( &tls_def_ctx_mutex );
return rc;
}
......
......@@ -41,10 +41,6 @@
#include "ldap-int.h"
#include "ldap-tls.h"
#ifdef LDAP_R_COMPILE
#include <ldap_pvt_thread.h>
#endif
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#include <gcrypt.h>
......@@ -257,13 +253,9 @@ static void
tlsg_ctx_ref( tls_ctx *ctx )
{
tlsg_ctx *c = (tlsg_ctx *)ctx;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &c->ref_mutex );
#endif
LDAP_MUTEX_LOCK( &c->ref_mutex );
c->refcount++;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &c->ref_mutex );
#endif
LDAP_MUTEX_UNLOCK( &c->ref_mutex );
}
static void
......@@ -274,13 +266,9 @@ tlsg_ctx_free ( tls_ctx *ctx )
if ( !c ) return;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &c->ref_mutex );
#endif
LDAP_MUTEX_LOCK( &c->ref_mutex );
refcount = --c->refcount;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &c->ref_mutex );
#endif
LDAP_MUTEX_UNLOCK( &c->ref_mutex );
if ( refcount )
return;
#ifdef HAVE_CIPHERSUITES
......
......@@ -42,10 +42,6 @@
#include "ldap-int.h"
#include "ldap-tls.h"
#ifdef LDAP_R_COMPILE
#include <ldap_pvt_thread.h>
#endif
#define READ_PASSWORD_FROM_STDIN
#define READ_PASSWORD_FROM_FILE
......@@ -1772,13 +1768,9 @@ static void
tlsm_ctx_ref( tls_ctx *ctx )
{
tlsm_ctx *c = (tlsm_ctx *)ctx;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &c->tc_refmutex );
#endif
LDAP_MUTEX_LOCK( &c->tc_refmutex );
c->tc_refcnt++;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &c->tc_refmutex );
#endif
LDAP_MUTEX_UNLOCK( &c->tc_refmutex );
}
static void
......@@ -1789,13 +1781,9 @@ tlsm_ctx_free ( tls_ctx *ctx )
if ( !c ) return;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &c->tc_refmutex );
#endif
LDAP_MUTEX_LOCK( &c->tc_refmutex );
refcount = --c->tc_refcnt;
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &c->tc_refmutex );
#endif
LDAP_MUTEX_UNLOCK( &c->tc_refmutex );
if ( refcount )
return;
if ( c->tc_model )
......
......@@ -37,10 +37,6 @@
#include "ldap-int.h"
#include "ldap-tls.h"
#ifdef LDAP_R_COMPILE
#include <ldap_pvt_thread.h>
#endif
#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
#include <openssl/x509v3.h>
......@@ -1214,14 +1210,10 @@ tlso_tmp_dh_cb( SSL *ssl, int is_export, int key_length )
int i;
/* Do we have params of this length already? */
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &tlso_dh_mutex );
#endif
LDAP_MUTEX_LOCK( &tlso_dh_mutex );
for ( p = tlso_dhparams; p; p=p->next ) {
if ( p->keylength == key_length ) {
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &tlso_dh_mutex );
#endif
LDAP_MUTEX_UNLOCK( &tlso_dh_mutex );
return p->param;
}
}
......@@ -1254,9 +1246,7 @@ tlso_tmp_dh_cb( SSL *ssl, int is_export, int key_length )
}
}
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &tlso_dh_mutex );
#endif
LDAP_MUTEX_UNLOCK( &tlso_dh_mutex );
return dh;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment