From: Pierangelo Masarati Date: Wed, 8 Dec 2004 19:11:27 +0000 (+0000) Subject: minor cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~88 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fefa59059de9aa842b139feae95fb66d6c18aa12;p=openldap minor cleanup --- diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 5c12055615..47e0941cba 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -70,7 +70,7 @@ ldap_back_bind( Operation *op, SlapReply *rs ) rc = ldap_back_op_result( lc, op, rs, msgid, 1 ); if ( rc == LDAP_SUCCESS ) { -#ifdef LDAP_BACK_PROXY_AUTHZ +#if defined(LDAP_BACK_PROXY_AUTHZ) if ( li->idassert_flags & LDAP_BACK_AUTH_OVERRIDE ) { ldap_back_proxy_authz_bind( lc, op, rs ); if ( lc->lc_bound == 0 ) { diff --git a/servers/slapd/back-ldap/config.c b/servers/slapd/back-ldap/config.c index 2426443b98..f80d7d0d25 100644 --- a/servers/slapd/back-ldap/config.c +++ b/servers/slapd/back-ldap/config.c @@ -74,6 +74,7 @@ ldap_back_db_config( if ( li->url != NULL ) { ch_free( li->url ); } + l = strlen( argv[1] ) + STRLENOF( "ldap:///") + 1; li->url = ch_calloc( l, sizeof( char ) ); if ( li->url == NULL ) { diff --git a/servers/slapd/back-ldap/init.c b/servers/slapd/back-ldap/init.c index 5a06904f11..e57190c2e2 100644 --- a/servers/slapd/back-ldap/init.c +++ b/servers/slapd/back-ldap/init.c @@ -121,7 +121,8 @@ ldap_back_db_open( BackendDB *be ) struct ldapinfo *li = (struct ldapinfo *)be->be_private; Debug( LDAP_DEBUG_TRACE, - "ldap_back_db_open: URI=%s\n", li->url, 0, 0 ); + "ldap_back_db_open: URI=%s\n", + li->url != NULL ? li->url : "", 0, 0 ); #ifdef LDAP_BACK_PROXY_AUTHZ /* by default, use proxyAuthz control on each operation */ @@ -200,7 +201,7 @@ ldap_back_db_destroy( ldap_pvt_thread_mutex_lock( &li->conn_mutex ); - if ( li->url ) { + if ( li->url != NULL ) { ch_free( li->url ); li->url = NULL; } diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index b9b52c9b03..67285793ff 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -344,12 +344,14 @@ monitor_subsys_database_init( #if defined(SLAPD_LDAP) if ( strcmp( bi->bi_type, "ldap" ) == 0 ) { - struct ldapinfo *li = (struct ldapinfo *)be->be_private; + struct ldapinfo *li = + (struct ldapinfo *)be->be_private; struct berval bv; - bv.bv_val = li->url; - bv.bv_len = strlen( bv.bv_val ); - attr_merge_normalize_one( e, slap_schema.si_ad_labeledURI, + ber_str2bv( li->url, 0, 0, &bv ); + + attr_merge_normalize_one( e, + slap_schema.si_ad_labeledURI, &bv, NULL ); } #endif /* defined(SLAPD_LDAP) */