int used;
BerVarray dn;
BerVarray ndn;
+ struct berval csn; /* an arbitrary old CSN */
} purge_data;
static int
if ( slapd_shutdown ) return 0;
+ /* Remember old CSN */
+ if ( pd->csn.bv_val[0] == '\0' ) {
+ Attribute *a = attr_find( rs->sr_entry->e_attrs,
+ slap_schema.si_ad_entryCSN );
+ if ( a ) {
+ int len = a->a_vals[0].bv_len;
+ if ( len > pd->csn.bv_len )
+ len = pd->csn.bv_len;
+ AC_MEMCPY( pd->csn.bv_val, a->a_vals[0].bv_val, len );
+ pd->csn.bv_len = len;
+ }
+ }
if ( pd->used >= pd->slots ) {
pd->slots += PURGE_INCREMENT;
pd->dn = ch_realloc( pd->dn, pd->slots * sizeof( struct berval ));
AttributeAssertion ava = {0};
purge_data pd = {0};
char timebuf[LDAP_LUTIL_GENTIME_BUFSIZE];
+ char csnbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
time_t old = slap_get_time();
connection_fake_init( &conn, op, ctx );
op->ors_attrs = slap_anlist_no_attrs;
op->ors_attrsonly = 1;
+ pd.csn.bv_len = sizeof( csnbuf );
+ pd.csn.bv_val = csnbuf;
+ csnbuf[0] = '\0';
cb.sc_private = &pd;
op->o_bd->be_search( op, &rs );
op->o_tag = LDAP_REQ_DELETE;
op->o_callback = &nullsc;
+ op->o_csn = pd.csn;
for (i=0; i<pd.used; i++) {
op->o_req_dn = pd.dn[i];