Commit 0d475ca4 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

cleanup

parent 36380047
......@@ -1681,7 +1681,8 @@ add_syncrepl(
} else {
Debug( LDAP_DEBUG_CONFIG,
"Config: ** successfully added syncrepl \"%s\"\n",
si->si_provideruri == NULL ? "(null)" : si->si_provideruri, 0, 0 );
BER_BVISNULL( &si->si_provideruri ) ?
"(null)" : si->si_provideruri.bv_val, 0, 0 );
if ( !si->si_schemachecking ) {
SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NO_SCHEMA_CHECK;
}
......@@ -1770,13 +1771,7 @@ parse_syncrepl_line(
STRLENOF( PROVIDERSTR "=" ) ) )
{
val = cargv[ i ] + STRLENOF( PROVIDERSTR "=" );
si->si_provideruri = ch_strdup( val );
si->si_provideruri_bv = (BerVarray)
ch_calloc( 2, sizeof( struct berval ));
ber_str2bv( si->si_provideruri, strlen( si->si_provideruri ),
1, &si->si_provideruri_bv[0] );
si->si_provideruri_bv[1].bv_len = 0;
si->si_provideruri_bv[1].bv_val = NULL;
ber_str2bv( val, 0, 1, &si->si_provideruri );
gots |= GOT_PROVIDER;
} else if ( !strncasecmp( cargv[ i ], STARTTLSSTR "=",
STRLENOF(STARTTLSSTR "=") ) )
......
......@@ -1481,8 +1481,7 @@ LDAP_STAILQ_HEAD( slap_sync_cookie_s, sync_cookie );
typedef struct syncinfo_s {
struct slap_backend_db *si_be;
long si_rid;
char *si_provideruri;
BerVarray si_provideruri_bv;
struct berval si_provideruri;
#define SYNCINFO_TLS_OFF 0
#define SYNCINFO_TLS_ON 1
#define SYNCINFO_TLS_CRITICAL 2
......
......@@ -282,11 +282,11 @@ do_syncrep1(
psub = &si->si_be->be_nsuffix[0];
/* Init connection to master */
rc = ldap_initialize( &si->si_ld, si->si_provideruri );
rc = ldap_initialize( &si->si_ld, si->si_provideruri.bv_val );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY,
"do_syncrep1: ldap_initialize failed (%s)\n",
si->si_provideruri, 0, 0 );
si->si_provideruri.bv_val, 0, 0 );
return rc;
}
......@@ -317,7 +317,7 @@ do_syncrep1(
if( rc != LDAP_OPT_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "Error: ldap_set_option "
"(%s,SECPROPS,\"%s\") failed!\n",
si->si_provideruri, si->si_secprops, 0 );
si->si_provideruri.bv_val, si->si_secprops, 0 );
goto done;
}
}
......@@ -2074,11 +2074,8 @@ avl_ber_bvfree( void *v_bv )
void
syncinfo_free( syncinfo_t *sie )
{
if ( sie->si_provideruri ) {
ch_free( sie->si_provideruri );
}
if ( sie->si_provideruri_bv ) {
ber_bvarray_free( sie->si_provideruri_bv );
if ( !BER_BVISNULL( &sie->si_provideruri ) ) {
ch_free( sie->si_provideruri.bv_val );
}
if ( sie->si_binddn ) {
ch_free( sie->si_binddn );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment