~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to servers/slapd/back-meta/bind.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-09-07 13:41:10 UTC
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: james.westby@ubuntu.com-20090907134110-jsdrvn0atu1fex4m
Tags: upstream-2.4.18
ImportĀ upstreamĀ versionĀ 2.4.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenLDAP: pkg/ldap/servers/slapd/back-meta/bind.c,v 1.95.2.18 2009/01/22 00:01:07 kurt Exp $ */
 
1
/* $OpenLDAP: pkg/ldap/servers/slapd/back-meta/bind.c,v 1.95.2.20 2009/08/26 00:50:20 quanah Exp $ */
2
2
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3
3
 *
4
4
 * Copyright 1999-2009 The OpenLDAP Foundation.
223
223
 
224
224
                                while ( ( tmpmc = avl_delete( &mi->mi_conninfo.lai_tree, (caddr_t)mc, meta_back_conn_cmp ) ) != NULL )
225
225
                                {
 
226
                                        assert( !LDAP_BACK_PCONN_ISPRIV( mc ) );
226
227
                                        Debug( LDAP_DEBUG_TRACE,
227
 
                                                "=>meta_back_bind: destroying conn %ld (refcnt=%u)\n",
228
 
                                                LDAP_BACK_PCONN_ID( mc ), mc->mc_refcnt, 0 );
 
228
                                                "=>meta_back_bind: destroying conn %lu (refcnt=%u)\n",
 
229
                                                mc->mc_conn->c_connid, mc->mc_refcnt, 0 );
229
230
 
230
231
                                        if ( tmpmc->mc_refcnt != 0 ) {
231
232
                                                /* taint it */
538
539
        LDAP_BACK_CONN_ISBOUND_SET( msc );
539
540
        mc->mc_authz_target = candidate;
540
541
 
541
 
        if ( LDAP_BACK_SAVECRED( mi ) ) {
 
542
        if ( META_BACK_TGT_SAVECRED( mt ) ) {
542
543
                if ( !BER_BVISNULL( &msc->msc_cred ) ) {
543
544
                        memset( msc->msc_cred.bv_val, 0,
544
545
                                msc->msc_cred.bv_len );
660
661
                isroot = 1;
661
662
        }
662
663
 
663
 
        Debug( LDAP_DEBUG_TRACE,
664
 
                "%s meta_back_dobind: conn=%ld%s\n",
665
 
                op->o_log_prefix,
666
 
                LDAP_BACK_PCONN_ID( mc ),
667
 
                isroot ? " (isroot)" : "" );
 
664
        if ( LogTest( LDAP_DEBUG_TRACE ) ) {
 
665
                char buf[STRLENOF("4294967295U") + 1] = { 0 };
 
666
                mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) );
 
667
 
 
668
                Debug( LDAP_DEBUG_TRACE,
 
669
                        "%s meta_back_dobind: conn=%s%s\n",
 
670
                        op->o_log_prefix, buf,
 
671
                        isroot ? " (isroot)" : "" );
 
672
        }
668
673
 
669
674
        /*
670
675
         * all the targets are bound as pseudoroot
796
801
        }
797
802
 
798
803
done:;
799
 
        Debug( LDAP_DEBUG_TRACE,
800
 
                "%s meta_back_dobind: conn=%ld bound=%d\n",
801
 
                op->o_log_prefix, LDAP_BACK_PCONN_ID( mc ), bound );
 
804
        if ( LogTest( LDAP_DEBUG_TRACE ) ) {
 
805
                char buf[STRLENOF("4294967295U") + 1] = { 0 };
 
806
                mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) );
 
807
 
 
808
                Debug( LDAP_DEBUG_TRACE,
 
809
                        "%s meta_back_dobind: conn=%s bound=%d\n",
 
810
                        op->o_log_prefix, buf, bound );
 
811
        }
802
812
 
803
813
        if ( bound == 0 ) {
804
814
                meta_back_release_conn( mi, mc );
1539
1549
                                LDAP_BACK_CONN_ISBOUND_SET( msc );
1540
1550
                                ber_bvreplace( &msc->msc_bound_ndn, &binddn );
1541
1551
 
1542
 
                                if ( LDAP_BACK_SAVECRED( mi ) ) {
 
1552
                                if ( META_BACK_TGT_SAVECRED( mt ) ) {
1543
1553
                                        if ( !BER_BVISNULL( &msc->msc_cred ) ) {
1544
1554
                                                memset( msc->msc_cred.bv_val, 0,
1545
1555
                                                        msc->msc_cred.bv_len );