]> git.sur5r.net Git - openldap/commitdiff
Sync with HEAD
authorKurt Zeilenga <kurt@openldap.org>
Tue, 15 Nov 2005 21:25:46 +0000 (21:25 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 15 Nov 2005 21:25:46 +0000 (21:25 +0000)
15 files changed:
clients/tools/common.c
libraries/libldap/request.c
libraries/libldap/result.c
libraries/libldap/search.c
servers/slapd/at.c
servers/slapd/back-bdb/cache.c
servers/slapd/back-ldbm/cache.c
servers/slapd/back-meta/conn.c
servers/slapd/back-sql/entry-id.c
servers/slapd/back-sql/sql-wrap.c
servers/slapd/connection.c
servers/slapd/overlays/syncprov.c
servers/slapd/sl_malloc.c
servers/slurpd/ldap_op.c
servers/slurpd/ri.c

index 1729d492dfeb30d5ea16119c1dea226e546c6bbd..aa5f692f582acb98c60476497237c794eea878e0 100644 (file)
@@ -747,7 +747,7 @@ tool_args( int argc, char **argv )
                }
 
                ldap_memfree( api.ldapai_vendor_name );
-               ldap_value_free( api.ldapai_extensions );
+               ber_memvfree( (void **)api.ldapai_extensions );
        }
 
        if (protocol == -1)
index e317ae864edd1a03392fe403db8093cba571b5c2..84dc5a8e14deabf8aae727a3f8ce25613862730a 100644 (file)
@@ -604,7 +604,7 @@ ldap_dump_connection( LDAP *ld, LDAPConn *lconns, int all )
        LDAPConn        *lc;
        char            timebuf[32];
 
-       fprintf( stderr, "** ld %p Connection%s:\n", ld, all ? "s" : "" );
+       fprintf( stderr, "** ld %p Connection%s:\n", (void *)ld, all ? "s" : "" );
        for ( lc = lconns; lc != NULL; lc = lc->lconn_next ) {
                if ( lc->lconn_server != NULL ) {
                        fprintf( stderr, "* host: %s  port: %d%s\n",
@@ -651,7 +651,7 @@ ldap_dump_requests_and_responses( LDAP *ld )
 #ifdef LDAP_R_COMPILE
        ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex );
 #endif
-       fprintf( stderr, "** ld %p Outstanding Requests:\n", ld );
+       fprintf( stderr, "** ld %p Outstanding Requests:\n", (void *)ld );
        if (( lr = ld->ld_requests ) == NULL ) {
                fprintf( stderr, "   Empty\n" );
        }
@@ -669,7 +669,7 @@ ldap_dump_requests_and_responses( LDAP *ld )
 #ifdef LDAP_R_COMPILE
        ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
 #endif
-       fprintf( stderr, "** ld %p Response Queue:\n", ld );
+       fprintf( stderr, "** ld %p Response Queue:\n", (void *)ld );
        if (( lm = ld->ld_responses ) == NULL ) {
                fprintf( stderr, "   Empty\n" );
        }
index f080c04ff9a5a581a5d0f6ea16e0cdf44bc72479..e17210f93d4bb0be6da020a5442a66016b9320fa 100644 (file)
@@ -111,7 +111,7 @@ ldap_result(
        assert( ld != NULL );
        assert( result != NULL );
 
-       Debug( LDAP_DEBUG_TRACE, "ldap_result ld %p msgid %d\n", ld, msgid, 0 );
+       Debug( LDAP_DEBUG_TRACE, "ldap_result ld %p msgid %d\n", (void *)ld, msgid, 0 );
 
 #ifdef LDAP_R_COMPILE
        ldap_pvt_thread_mutex_lock( &ld->ld_res_mutex );
@@ -147,7 +147,7 @@ chkResponseList(
 
        Debug( LDAP_DEBUG_TRACE,
                "ldap_chkResponseList ld %p msgid %d all %d\n",
-           ld, msgid, all );
+               (void *)ld, msgid, all );
        lastlm = &ld->ld_responses;
        for ( lm = ld->ld_responses; lm != NULL; lm = nextlm ) {
                nextlm = lm->lm_next;
@@ -207,11 +207,11 @@ chkResponseList(
 #ifdef LDAP_DEBUG
        if( lm == NULL) {
                Debug( LDAP_DEBUG_TRACE,
-                       "ldap_chkResponseList returns ld %p NULL\n", ld, 0, 0);
+                       "ldap_chkResponseList returns ld %p NULL\n", (void *)ld, 0, 0);
        } else {
                Debug( LDAP_DEBUG_TRACE,
                        "ldap_chkResponseList returns ld %p msgid %d, type 0x%02lu\n",
-                       ld, lm->lm_msgid, (unsigned long) lm->lm_msgtype);
+                       (void *)ld, lm->lm_msgid, (unsigned long) lm->lm_msgtype);
        }
 #endif
     return lm;
@@ -239,10 +239,10 @@ wait4msg(
 #ifdef LDAP_DEBUG
        if ( timeout == NULL ) {
                Debug( LDAP_DEBUG_TRACE, "wait4msg ld %p msgid %d (infinite timeout)\n",
-                   ld, msgid, 0 );
+                       (void *)ld, msgid, 0 );
        } else {
                Debug( LDAP_DEBUG_TRACE, "wait4msg ld %p msgid %d (timeout %ld usec)\n",
-                   ld, msgid, (long)timeout->tv_sec * 1000000 + timeout->tv_usec );
+                       (void *)ld, msgid, (long)timeout->tv_sec * 1000000 + timeout->tv_usec );
        }
 #endif /* LDAP_DEBUG */
 
@@ -260,7 +260,7 @@ wait4msg(
 #ifdef LDAP_DEBUG
                if ( ldap_debug & LDAP_DEBUG_TRACE ) {
                        Debug( LDAP_DEBUG_TRACE, "wait4msg continue ld %p msgid %d all %d\n",
-                               ld, msgid, all );
+                               (void *)ld, msgid, all );
                        ldap_dump_connection( ld, ld->ld_conns, 1 );
                        ldap_dump_requests_and_responses( ld );
                }
@@ -368,7 +368,7 @@ wait4msg(
                        tv.tv_sec = tv0.tv_sec;
 
                        Debug( LDAP_DEBUG_TRACE, "wait4msg ld %p %ld secs to go\n",
-                              ld, (long) tv.tv_sec, 0 );
+                               (void *)ld, (long) tv.tv_sec, 0 );
                        start_time = tmp_time;
                }
        }
@@ -417,7 +417,8 @@ try_read1msg(
        assert( lcp != NULL );
        assert( *lcp != NULL );
        
-       Debug( LDAP_DEBUG_TRACE, "read1msg: ld %p msgid %d all %d\n", ld, msgid, all );
+       Debug( LDAP_DEBUG_TRACE, "read1msg: ld %p msgid %d all %d\n",
+               (void *)ld, msgid, all );
 
        lc = *lcp;
 
@@ -455,7 +456,7 @@ nextresp3:
                if ( tag == LBER_DEFAULT) {
 #ifdef LDAP_DEBUG                 
                        Debug( LDAP_DEBUG_CONNS,
-                             "ber_get_next failed.\n", 0, 0, 0 );
+                               "ber_get_next failed.\n", 0, 0, 0 );
 #endif            
 #ifdef EWOULDBLOCK                     
                        if (errno==EWOULDBLOCK) return -2;
@@ -480,7 +481,7 @@ nextresp3:
        /* if it's been abandoned, toss it */
        if ( ldap_abandoned( ld, id ) ) {
                Debug( LDAP_DEBUG_ANY, "abandoned ld %p msgid %ld\n",
-                        ld, (long) id, 0);
+                       (void *)ld, (long) id, 0);
 retry_ber:
                ber_free( ber, 1 );
                if ( ber_sockbuf_ctrl( sb, LBER_SB_OPT_DATA_READY, NULL ) ) {
@@ -492,8 +493,8 @@ retry_ber:
        lr = ldap_find_request_by_msgid( ld, id );
        if ( lr == NULL ) {
                Debug( LDAP_DEBUG_ANY,
-                   "no request for response on ld %p msgid %ld (tossing)\n",
-                   ld, (long) id, 0 );
+                       "no request for response on ld %p msgid %ld (tossing)\n",
+                       (void *)ld, (long) id, 0 );
                goto retry_ber;
        }
 #ifdef LDAP_CONNECTIONLESS
@@ -511,7 +512,7 @@ nextresp2:
 
        Debug( LDAP_DEBUG_TRACE,
                "read1msg: ld %p msgid %ld message type %s\n",
-               ld, (long) lr->lr_msgid, ldap_int_msgtype2str( tag ));
+               (void *)ld, (long) lr->lr_msgid, ldap_int_msgtype2str( tag ));
 
        id = lr->lr_origid;
        refer_cnt = 0;
@@ -609,8 +610,8 @@ nextresp2:
                                                        rc = LDAP_DECODING_ERROR;
                                                        lr->lr_status = LDAP_REQST_COMPLETED;
                                                        Debug( LDAP_DEBUG_TRACE,
-                                                           "read1msg: referral decode error, mark request completed, ld %p msgid %d\n",
-                                                                   ld, lr->lr_msgid, 0);
+                                                               "read1msg: referral decode error, mark request completed, ld %p msgid %d\n",
+                                                               (void *)ld, lr->lr_msgid, 0);
                                                } else {
                                                        /* Chase the referral 
                                                         * Note: refs arrary is freed by ldap_chase_v3referrals
@@ -619,8 +620,8 @@ nextresp2:
                                                            0, &lr->lr_res_error, &hadref );
                                                        lr->lr_status = LDAP_REQST_COMPLETED;
                                                        Debug( LDAP_DEBUG_TRACE,
-                                                           "read1msg: referral chased, mark request completed, ld %p msgid %d\n",
-                                                           ld, lr->lr_msgid, 0);
+                                                               "read1msg: referral chased, mark request completed, ld %p msgid %d\n",
+                                                               (void *)ld, lr->lr_msgid, 0);
                                                        if( refer_cnt > 0) {
                                                                /* Referral successfully chased */
                                                                v3ref = V3REF_SUCCESS;
@@ -742,7 +743,8 @@ nextresp2:
                }
 
                Debug( LDAP_DEBUG_TRACE,
-                   "read1msg: ld %p %d new referrals\n", ld, refer_cnt, 0 );
+                       "read1msg: ld %p %d new referrals\n",
+                       (void *)ld, refer_cnt, 0 );
 
                if ( refer_cnt != 0 ) { /* chasing referrals */
                        ber_free( ber, 1 );
@@ -763,7 +765,8 @@ nextresp2:
 
                        lr->lr_status = LDAP_REQST_COMPLETED; /* declare this request done */
                        Debug( LDAP_DEBUG_TRACE,
-                           "read1msg:  mark request completed, ld %p msgid %d\n", ld, lr->lr_msgid, 0);
+                               "read1msg:  mark request completed, ld %p msgid %d\n",
+                               (void *)ld, lr->lr_msgid, 0);
                        while ( lr->lr_parent != NULL ) {
                                merge_error_info( ld, lr->lr_parent, lr );
 
@@ -791,7 +794,7 @@ nextresp2:
                                id = lr->lr_msgid;
                                tag = lr->lr_res_msgtype;
                                Debug( LDAP_DEBUG_ANY, "request done: ld %p msgid %ld\n",
-                                   ld, (long) id, 0 );
+                                       (void *)ld, (long) id, 0 );
 Debug( LDAP_DEBUG_TRACE,
 "res_errno: %d, res_error: <%s>, res_matched: <%s>\n",
 lr->lr_res_errno, lr->lr_res_error ? lr->lr_res_error : "",
@@ -963,7 +966,7 @@ lr->lr_res_matched ? lr->lr_res_matched : "" );
        }
 
        Debug( LDAP_DEBUG_TRACE, "adding response ld %p msgid %ld type %ld:\n",
-           ld, (long) newmsg->lm_msgid, (long) newmsg->lm_msgtype );
+               (void *)ld, (long) newmsg->lm_msgid, (long) newmsg->lm_msgtype );
 
        /* part of a search response - add to end of list of entries */
        l->lm_chain_tail->lm_chain = newmsg;
index 9a637ef7dce1d848aee36583f5941514479282be..d6bd5f2dec95d4f5017e12921cfd00baac4b5657 100644 (file)
@@ -402,7 +402,7 @@ ldap_bv2escaped_filter_value( struct berval *in, struct berval *out )
 
        for( i=0; i<in->bv_len; i++ ) {
                char c = in->bv_val[ i ];
-               if (c & 0x80 || escape[ c ]) {
+               if (c & 0x80 || escape[ (unsigned)c ]) {
                        out->bv_val[out->bv_len++] = '\\';
                        out->bv_val[out->bv_len++] = "0123456789ABCDEF"[0x0f & (c>>4)];
                        out->bv_val[out->bv_len++] = "0123456789ABCDEF"[0x0f & c];
index 59bdb98142a23cf8882be565ef94941c41e9198a..8829b5541f222012e44f679b0ac1b449b4620599 100644 (file)
@@ -759,6 +759,7 @@ error_return:;
 }
 
 #ifdef LDAP_DEBUG
+#ifdef SLAPD_UNUSED
 static int
 at_index_printnode( void *v_air, void *ignore )
 {
@@ -776,6 +777,7 @@ at_index_print( void )
        (void) avl_apply( attr_index, at_index_printnode, 0, -1, AVL_INORDER );
 }
 #endif
+#endif
 
 void
 at_unparse( BerVarray *res, AttributeType *start, AttributeType *end, int sys )
index d7f41d5dac35eee335e8b9e6cd486984eccc16f1..8e39d952dffd3a597e9f0dbd6b248a5ef8f14090 100644 (file)
 
 static int     bdb_cache_delete_internal(Cache *cache, EntryInfo *e, int decr);
 #ifdef LDAP_DEBUG
+#ifdef SLAPD_UNUSED
 static void    bdb_lru_print(Cache *cache);
 #endif
+#endif
 
 static EntryInfo *
 bdb_cache_entryinfo_new( Cache *cache )
@@ -1223,6 +1225,7 @@ bdb_cache_release_all( Cache *cache )
 }
 
 #ifdef LDAP_DEBUG
+#ifdef SLAPD_UNUSED
 static void
 bdb_lru_print( Cache *cache )
 {
@@ -1240,6 +1243,7 @@ bdb_lru_print( Cache *cache )
        }
 }
 #endif
+#endif
 
 #ifdef BDB_REUSE_LOCKERS
 static void
index e98cfdce80d263b8056c08f11b8cd73c735fb910..585f5d705b7bd399654deaa9812948eb50c9bfec 100644 (file)
@@ -48,8 +48,10 @@ typedef struct ldbm_entry_info {
 
 static int     cache_delete_entry_internal(Cache *cache, Entry *e);
 #ifdef LDAP_DEBUG
+#ifdef SLAPD_UNUSED
 static void    lru_print(Cache *cache);
 #endif
+#endif
 
 static int
 cache_entry_private_init( Entry*e )
@@ -652,6 +654,7 @@ cache_release_all( Cache *cache )
 }
 
 #ifdef LDAP_DEBUG
+#ifdef SLAPD_UNUSED
 static void
 lru_print( Cache *cache )
 {
@@ -669,3 +672,4 @@ lru_print( Cache *cache )
        }
 }
 #endif
+#endif
index 384e07b6f1f4b96eb8d1745f186fad567063dee8..caaff03b5ab45f689466c090695c5093c82c7984 100644 (file)
@@ -283,8 +283,15 @@ retry:;
                                rs->sr_err = ldap_parse_extended_result( msc->msc_ld, res,
                                                NULL, &data, 0 );
                                if ( rs->sr_err == LDAP_SUCCESS ) {
-                                       rs->sr_err = ldap_result2error( msc->msc_ld, res, 1 );
+                                       int             err;
+
+                                       rs->sr_err = ldap_parse_result( msc->msc_ld, res,
+                                               &err, NULL, NULL, NULL, NULL, 1 );
                                        res = NULL;
+
+                                       if ( rs->sr_err == LDAP_SUCCESS ) {
+                                               rs->sr_err = err;
+                                       }
                                        
                                        /* FIXME: in case a referral 
                                         * is returned, should we try
index d0aafa16458795fe463c97d2f80377460f30b76d..213fd7096c06c407333458d1610d051d1254f94f 100644 (file)
@@ -550,7 +550,7 @@ backsql_get_attr_vals( void *v_at, void *v_bsi )
        }
 
        Debug( LDAP_DEBUG_TRACE, "backsql_get_attr_vals(): "
-               "number of values in query: %lu\n", count, 0, 0 );
+               "number of values in query: %u\n", count, 0, 0 );
        SQLFreeStmt( sth, SQL_DROP );
        if ( count == 0 ) {
                return 1;
index e942a17d65769776d08203caf11e7c4727a742fd..343b47e3aa7f1a94f655668a77b2d2bf086318ff 100644 (file)
@@ -434,7 +434,7 @@ backsql_free_db_conn( Operation *op )
        if ( conn != NULL ) {
                Debug( LDAP_DEBUG_TRACE, "backsql_free_db_conn(): "
                        "closing db connection %lu (%p)\n",
-                       op->o_connid, conn, 0 );
+                       op->o_connid, (void *)conn, 0 );
                backsql_close_db_conn( (void *)conn );
        }
 
index 54bd488a9f399b3283ea5ccd25cef0d720a6606b..c2be214f59f3e442408da0b329610b34e6253723 100644 (file)
@@ -2055,6 +2055,8 @@ static int connection_bind_cb( Operation *op, SlapReply *rs )
        ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
 
        ch_free( cb );
+       op->o_callback = NULL;
+
        return SLAP_CB_CONTINUE;
 }
 
index afe894f795bf021f2a8a5f46885d47591f7f80b1..a9d71afa581132c4e7f754c5a5ddd6230b4a416f 100644 (file)
@@ -1222,6 +1222,7 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
        syncprov_info_t         *si = on->on_bi.bi_private;
        Modifications mod;
        Operation opm;
+       SlapReply rsm;
        struct berval bv[2];
        slap_callback cb = {0};
 
@@ -1243,7 +1244,7 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
        opm.o_req_ndn = op->o_bd->be_nsuffix[0];
        opm.o_bd->bd_info = on->on_info->oi_orig;
        opm.o_managedsait = SLAP_CONTROL_NONCRITICAL;
-       opm.o_bd->be_modify( &opm, rs );
+       opm.o_bd->be_modify( &opm, &rsm );
        if ( mod.sml_next != NULL ) {
                slap_mods_free( mod.sml_next, 1 );
        }
index e5d78627dd864e9408ac8bb3aa12c5f091a3ad35..9960be90b1e7cbf3b5cbbed9df985ab7560b5694 100644 (file)
@@ -22,7 +22,9 @@
 #include "slap.h"
 
 static struct slab_object * slap_replenish_sopool(struct slab_heap* sh);
+#ifdef SLAPD_UNUSED
 static void print_slheap(int level, void *ctx);
+#endif
 
 void
 slap_sl_mem_destroy(
@@ -598,6 +600,7 @@ slap_replenish_sopool(
     return so_block;
 }
 
+#ifdef SLAPD_UNUSED
 static void
 print_slheap(int level, void *ctx)
 {
@@ -638,3 +641,4 @@ print_slheap(int level, void *ctx)
                }
        }
 }
+#endif
index b33a74a49a7dce79310d88a7ab29a08e4d14a8c4..283f5249571d34c4446807a71d5e5ba51a2e7e61 100644 (file)
@@ -61,7 +61,9 @@ static LDAPMod *alloc_ldapmod LDAP_P(( void ));
 static void free_ldapmod LDAP_P(( LDAPMod * ));
 static void free_ldmarr LDAP_P(( LDAPMod ** ));
 static int getmodtype LDAP_P(( char * ));
+#ifdef SLAPD_UNUSED
 static void dump_ldm_array LDAP_P(( LDAPMod ** ));
+#endif
 static int do_bind LDAP_P(( Ri *, int * ));
 static int do_unbind LDAP_P(( Ri * ));
 
@@ -877,6 +879,7 @@ retry:
 /*
  * For debugging.  Print the contents of an ldmarr array.
  */
+#ifdef SLAPD_UNUSED
 static void
 dump_ldm_array(
     LDAPMod **ldmarr
@@ -910,3 +913,4 @@ dump_ldm_array(
        }
     }
 }
+#endif
index 32cdd184487ce5388d0da19a9705e03e463ca2af..794d5fb75d93deb679a571aa1be44c24a5806e10 100644 (file)
@@ -158,7 +158,7 @@ Ri_process(
        rq->rq_unlock( rq );
        if ( sglob->slurpd_shutdown ) {
            if ( ri->ri_ldp ) {
-               ldap_unbind( ri->ri_ldp );
+               ldap_unbind_ext( ri->ri_ldp, NULL, NULL );
                ri->ri_ldp = NULL;
            }
            return 0;