]> git.sur5r.net Git - openldap/commitdiff
ITS#5309: new api
authorQuanah Gibson-Mount <quanah@openldap.org>
Mon, 11 Feb 2008 23:00:51 +0000 (23:00 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 11 Feb 2008 23:00:51 +0000 (23:00 +0000)
servers/slapd/backend.c
servers/slapd/overlays/memberof.c
servers/slapd/passwd.c

index 3eb2a679d4bfeefa6dc3a3371d9dcef9968b8be1..e29d2ba8b881baad99e4286c57142b96a3ffa8e9 100644 (file)
@@ -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 );
index f198f71766fb6ae7902600d51dde1fdde4a36a60..064024b1be6d405363b7eade404c8d807890deaf 100644 (file)
@@ -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 ) );
 
index 7444b179c2697970684791e1a29d5385ccf8c407..a722ef9d7c91753e3070ca1c0ef48cfd729a3fe6 100644 (file)
@@ -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;