- int rc;
-
- struct berval sub_bv = { 0, NULL };
- struct berval psubrdn = { 0, NULL };
-
- slap_callback cb;
- SlapReply rs = {REP_RESULT};
-
- struct berval rdn = { 0, NULL };
- int match = 0;
- char *def_filter_str = NULL;
-
- ocbva = ( struct berval * ) ch_calloc( 4, sizeof( struct berval ));
- socbva = ( struct berval * ) ch_calloc( 2, sizeof( struct berval ));
- cnbva = ( struct berval * ) ch_calloc( 2, sizeof( struct berval ));
- ssbva = ( struct berval * ) ch_calloc( 2, sizeof( struct berval ));
- scbva = ( struct berval * ) ch_calloc( 2, sizeof( struct berval ));
-
- ber_str2bv( "top", strlen("top"), 1, &ocbva[0] );
- ber_str2bv( "subentry", strlen("subentry"), 1, &ocbva[1] );
- ber_str2bv( "syncProviderSubentry",
- strlen("syncProviderSubentry"), 1, &ocbva[2] );
- ocbva[3].bv_len = 0;
- ocbva[3].bv_val = NULL;
-
- mod = (Modifications *) ch_malloc( sizeof( Modifications ));
- mod->sml_op = LDAP_MOD_REPLACE;
- mod->sml_next = NULL;
- mod->sml_desc = NULL;
- ber_str2bv( "objectClass", strlen("objectClass"), 1, &mod->sml_type );
- mod->sml_bvalues = ocbva;
- mod->sml_nvalues = NULL;
- *modtail = mod;
- modtail = &mod->sml_next;
-
- ber_str2bv( "syncProviderSubentry",
- strlen("syncProviderSubentry"), 1, &socbva[0] );
- socbva[1].bv_len = 0;
- socbva[1].bv_val = NULL;
-
- mod = (Modifications *) ch_malloc( sizeof( Modifications ));
- mod->sml_op = LDAP_MOD_REPLACE;
- mod->sml_next = NULL;
- mod->sml_desc = NULL;
- ber_str2bv( "structuralObjectClass", strlen("structuralObjectClass"), 1, &mod->sml_type );
- mod->sml_bvalues = socbva;
- mod->sml_nvalues = NULL;
- *modtail = mod;
- modtail = &mod->sml_next;
-
- sprintf( substr, "ldapsync" );
- sprintf( rdnstr, "cn=%s", substr );
- ber_str2bv( substr, strlen( substr ), 1, &cnbva[0] );
- ber_str2bv( rdnstr, strlen( rdnstr ), 1, &psubrdn );
- cnbva[1].bv_len = 0;
- cnbva[1].bv_val = NULL;
- mod = (Modifications *) ch_malloc( sizeof( Modifications ));
- mod->sml_op = LDAP_MOD_REPLACE;
- mod->sml_next = NULL;
- mod->sml_desc = NULL;
- ber_str2bv( "cn", strlen("cn"), 1, &mod->sml_type );
- mod->sml_bvalues = cnbva;
- mod->sml_nvalues = NULL;
- *modtail = mod;
- modtail = &mod->sml_next;