From: Quanah Gibson-Mount Date: Mon, 11 Feb 2008 23:00:51 +0000 (+0000) Subject: ITS#5309: new api X-Git-Tag: OPENLDAP_REL_ENG_2_4_8~81 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a7f867c233a463f989038a56efb73061e7a8bac2;p=openldap ITS#5309: new api --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 3eb2a679d4..e29d2ba8b8 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -795,6 +795,9 @@ int be_rootdn_bind( Operation *op, SlapReply *rs ) { int rc; +#ifdef SLAPD_SPASSWD + void *old_authctx = NULL; +#endif assert( op->o_tag == LDAP_REQ_BIND ); assert( op->orb_method == LDAP_AUTH_SIMPLE ); @@ -819,14 +822,15 @@ be_rootdn_bind( Operation *op, SlapReply *rs ) } #ifdef SLAPD_SPASSWD - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - op->o_conn->c_sasl_authctx, NULL ); + ldap_pvt_thread_pool_setkey_x( op->o_threadctx, slap_sasl_bind, + op->o_conn->c_sasl_authctx, NULL, &old_authctx, NULL ); #endif rc = lutil_passwd( &op->o_bd->be_rootpw, &op->orb_cred, NULL, NULL ); #ifdef SLAPD_SPASSWD - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, NULL, NULL ); + ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, + old_authctx, NULL ); #endif rc = ( rc == 0 ? LDAP_SUCCESS : LDAP_INVALID_CREDENTIALS ); diff --git a/servers/slapd/overlays/memberof.c b/servers/slapd/overlays/memberof.c index f198f71766..064024b1be 100644 --- a/servers/slapd/overlays/memberof.c +++ b/servers/slapd/overlays/memberof.c @@ -194,7 +194,7 @@ memberof_saved_member_free( void *key, void *data ) static BerVarray memberof_saved_member_get( Operation *op, void *keyp ) { - BerVarray vals; + void *vals; BerVarray *key = (BerVarray *)keyp; assert( op != NULL ); @@ -204,10 +204,8 @@ memberof_saved_member_get( Operation *op, void *keyp ) *key = NULL; } else { - ldap_pvt_thread_pool_getkey( op->o_threadctx, - key, (void **)&vals, NULL ); - ldap_pvt_thread_pool_setkey( op->o_threadctx, - key, NULL, NULL ); + ldap_pvt_thread_pool_setkey_x( op->o_threadctx, + key, NULL, NULL, &vals, NULL ); } return vals; @@ -232,7 +230,7 @@ memberof_saved_member_set( Operation *op, void *keyp, BerVarray vals ) *key = saved_vals; } else { - BerVarray old_vals = NULL; + void *old_vals = NULL; ldap_pvt_thread_pool_setkey_x( op->o_threadctx, key, saved_vals, memberof_saved_member_free, &old_vals, NULL ); @@ -1515,7 +1513,7 @@ memberof_db_init( ConfigReply *cr ) { slap_overinst *on = (slap_overinst *)be->bd_info; - memberof_t tmp_mo = { 0 }, *mo; + memberof_t *mo; mo = (memberof_t *)ch_calloc( 1, sizeof( memberof_t ) ); diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 7444b179c2..a722ef9d7c 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -505,8 +505,10 @@ slap_passwd_check( AccessControlState acl_state = ACL_STATE_INIT; #ifdef SLAPD_SPASSWD - ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - op->o_conn->c_sasl_authctx, NULL ); + void *old_authctx = NULL; + + ldap_pvt_thread_pool_setkey_x( op->o_threadctx, slap_sasl_bind, + op->o_conn->c_sasl_authctx, NULL, &old_authctx, NULL ); #endif for ( bv = a->a_vals; bv->bv_val != NULL; bv++ ) { @@ -525,7 +527,7 @@ slap_passwd_check( #ifdef SLAPD_SPASSWD ldap_pvt_thread_pool_setkey( op->o_threadctx, slap_sasl_bind, - NULL, NULL ); + old_authctx, NULL ); #endif return result;