]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/tools/centipede.c
Import minor trace output cleanup
[openldap] / servers / slapd / tools / centipede.c
index 25cc1a0ef45fa75c2e3867942a0c6e3f879b478d..306203427843922e4f48f4f862f0478ea9a0539f 100644 (file)
@@ -90,8 +90,8 @@ main( int argc, char **argv )
 
        ldapsrcurl = NULL;
        ldapdesturl = NULL;
-       ldaphost = LDAPHOST;
-       ldapbase = DEFAULT_BASE;
+       ldaphost = NULL;
+       ldapbase = NULL;
        srcldapauthmethod = LDAP_AUTH_SIMPLE;
        destldapauthmethod = LDAP_AUTH_SIMPLE;
        srcldapbinddn = NULL;
@@ -384,7 +384,7 @@ start_ldap_search(
                fflush( stdout );
        }
 
-       if ( (ld = ldap_open( ldaphost, LDAP_PORT )) == NULL ) {
+       if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
                perror( "ldap_open" );
                return( NULL );
        }
@@ -474,6 +474,8 @@ generate_new_centroids(
        char            **val;
        char            last;
 
+       ldbm_datum_init( data );
+
        if ( verbose ) {
                printf( "Generating new centroids for..." );
                fflush( stdout );
@@ -496,6 +498,9 @@ generate_new_centroids(
 
                        /* for each value */
                        for ( j = 0; val[j] != NULL; j++ ) {
+
+                               ldbm_datum_init( key );
+
                                /* normalize the value */
                                for ( s = val[j]; *s; s++ ) {
                                        if ( isascii( *s ) ) {
@@ -571,6 +576,14 @@ diff_centroids(
                fflush( stdout );
        }
 
+       ldbm_datum_init( okey );
+       ldbm_datum_init( nkey );
+       ldbm_datum_init( olast );
+       ldbm_datum_init( nlast );
+       ldbm_datum_init( lastkey );
+       ldbm_datum_init( key );
+       ldbm_datum_init( data );
+
        if ( (mods = (LDAPMod **) malloc( sizeof(LDAPMod *) * 4 )) == NULL ||
             (mods[0] = (LDAPMod *) malloc( sizeof(LDAPMod) )) == NULL ||
             (mods[1] = (LDAPMod *) malloc( sizeof(LDAPMod) )) == NULL ||
@@ -833,6 +846,9 @@ full_centroid(
                fflush( stdout );
        }
 
+       ldbm_datum_init( key );
+       ldbm_datum_init( lastkey );
+
        if ( (mods = (LDAPMod **) malloc( sizeof(LDAPMod *) * 3 )) == NULL ||
             (mods[0] = (LDAPMod *) malloc( sizeof(LDAPMod) )) == NULL ||
             (mods[1] = (LDAPMod *) malloc( sizeof(LDAPMod) )) == NULL ||
@@ -961,7 +977,7 @@ bind_to_destination_ldap(
        free( ldapbase );
        ldapbase = strdup( buf );
 
-       if ( (ld = ldap_open( ldaphost, LDAP_PORT )) == NULL ) {
+       if ( (ld = ldap_open( ldaphost, 0 )) == NULL ) {
                perror( "ldap_open" );
                return( NULL );
        }