]> git.sur5r.net Git - openldap/commitdiff
minor cleanup
authorPierangelo Masarati <ando@openldap.org>
Wed, 8 Dec 2004 19:11:27 +0000 (19:11 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 8 Dec 2004 19:11:27 +0000 (19:11 +0000)
servers/slapd/back-ldap/bind.c
servers/slapd/back-ldap/config.c
servers/slapd/back-ldap/init.c
servers/slapd/back-monitor/database.c

index 5c1205561580a020120076c80681062885b853d3..47e0941cba60303c4b5835dd6ded28217701f335 100644 (file)
@@ -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 ) {
index 2426443b98e226ec9ab8622d31282d633d32a972..f80d7d0d2518ca80f2f93ef57905a8a671df4db0 100644 (file)
@@ -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 ) {
index 5a06904f118286c8ade0576e2b40e6f16420e588..e57190c2e21192e60e855b6f891d08a35a00c1cc 100644 (file)
@@ -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;
                }
index b9b52c9b03b6508606823c0f23c58c84a1402d32..67285793ffe24cc3f9caffc4397c24f077b79d36 100644 (file)
@@ -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) */