Fixed liblutil getpass prompts (ITS#6702)
Fixed ldapsearch segfault with deref (ITS#6638)
Fixed ldapsearch multiple controls parsing (ITS#6651)
+ Fixed slapd SlapyReply usage (ITS#6758)
Fixed slapd acl parsing overflow (ITS#6611)
Fixed slapd assert control (ITS#5862)
Fixed slapd assertions and debugging (ITS#6759)
static int addpartial_add( Operation *op, SlapReply *rs)
{
Operation nop = *op;
- SlapReply nrs = { REP_RESULT };
Entry *toAdd = NULL;
Entry *found = NULL;
slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
Debug(LDAP_DEBUG_TRACE, "%s: mods to do...\n",
addpartial.on_bi.bi_type, 0, 0);
- memset(&nrs, 0, sizeof(nrs));
- nrs.sr_type = REP_RESULT;
- nrs.sr_err = LDAP_SUCCESS;
- nrs.sr_entry = NULL;
- nrs.sr_text = NULL;
-
nop.o_tag = LDAP_REQ_MODIFY;
nop.orm_modlist = mods;
nop.orm_no_opattrs = 0;
if(nop.o_bd->be_modify)
{
+ SlapReply nrs = { REP_RESULT };
rc = (nop.o_bd->be_modify)(&nop, &nrs);
}
o.o_bd->bd_info = (BackendInfo *)on;
if ( modify == 1 && agg.agg_mod ) {
+ rs_reinit( &rs, REP_RESULT );
+
o = *op;
o.o_callback = &null_cb;
o.o_tag = LDAP_REQ_MODIFY;
autogroup_def_t *agd;
autogroup_sc_t ags;
Operation *op;
- SlapReply rs = { REP_RESULT };
slap_callback cb = { 0 };
void *thrctx = ldap_pvt_thread_pool_context();
op->o_callback = &cb;
for (agd = agi->agi_def ; agd ; agd = agd->agd_next) {
+ SlapReply rs = { REP_RESULT };
autogroup_build_def_filter(agd, op);
/*
* We are now committed to cloak an attribute.
*/
- if ( rs->sr_flags & REP_ENTRY_MODIFIABLE )
- me = e;
- else
- me = entry_dup( e );
+ rs_ensure_entry_modifiable( op, rs, (slap_overinst *) op->o_bd->bd_info );
+ me = rs->sr_entry;
for ( ci = (cloak_info_t *)sc->sc_private; ci; ci = ci->ci_next ) {
Attribute *a;
}
- if ( me != e ) {
- if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED )
- entry_free( e );
-
- rs->sr_entry = me;
- rs->sr_flags |= REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED;
- }
-
return ( SLAP_CB_CONTINUE );
}
int32_t tmpint32;
int rc;
slap_callback cb = {0};
- SlapReply rs = {REP_RESULT};
char dnc[1024];
char uidc[32];
char svcc[256];
int rc;
Entry *e = NULL;
Attribute *a;
- SlapReply rs = {REP_RESULT};
slap_callback cb = {0};
READ_STRING(fp,uidc);
AttributeAssertion ava = ATTRIBUTEASSERTION_INIT;
struct berval hostdn = BER_BVNULL;
struct berval odn = op->o_ndn;
+ SlapReply rs = {REP_RESULT};
op->o_dn = dn;
op->o_ndn = dn;
{
!BER_BVISEMPTY(&ni->ni_pam_defhost)) {
filter.bv_len = sizeof(fbuf);
filter.bv_val = fbuf;
- memset(&rs2, 0, sizeof(rs2));
- rs2.sr_type = REP_RESULT;
+ rs_reinit(&rs2, REP_RESULT);
nssov_filter_byname(mi,0,&ni->ni_pam_defhost,&filter);
op->ors_filterstr = filter;
op->ors_filter = str2filter_x(op, filter.bv_val);
!BER_BVISEMPTY(&ni->ni_pam_group_dn) &&
ni->ni_pam_group_ad) {
AttributeAssertion ava = ATTRIBUTEASSERTION_INIT;
+ SlapReply rs = {REP_RESULT};
op->o_callback = &cb;
cb.sc_response = slap_null_cb;
op->o_tag = LDAP_REQ_COMPARE;
struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
Entry *e = NULL;
EntryInfo *ei;
- Attribute *a;
int manageDSAit = get_manageDSAit( op );
DB_TXN *rtxn;
DB *db = bdb->bi_dn2id->bdi_db;
char *buf;
DBT key;
- DB_LOCK lock;
struct berval pdn, ptr;
int rc;
int rc;
ID nid;
unsigned char dlen[2];
- DB_LOCK lock;
Debug( LDAP_DEBUG_TRACE, "=> hdb_dn2id_delete 0x%lx: \"%s\"\n",
e->e_id, e->e_ndn, 0 );
goto loop_continue;
}
- rs->sr_entry = e;
-
if ( is_entry_subentry( e ) ) {
if( op->oq_search.rs_scope != LDAP_SCOPE_BASE ) {
if(!get_subentries_visibility( op )) {
blis.bli_lock = lock;
blis.bli_flag = BLI_DONTFREE;
+ rs->sr_entry = e;
rs->sr_flags = REP_ENTRY_MUSTRELEASE;
send_search_reference( op, rs );
}
/* if it matches the filter and scope, send it */
- rs->sr_err = test_filter( op, rs->sr_entry, op->oq_search.rs_filter );
+ rs->sr_err = test_filter( op, e, op->oq_search.rs_filter );
if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
/* check size limit */
rs->sr_attrs = op->oq_search.rs_attrs;
rs->sr_operational_attrs = NULL;
rs->sr_ctrls = NULL;
+ rs->sr_entry = e;
+ RS_ASSERT( e->e_private != NULL );
rs->sr_flags = REP_ENTRY_MUSTRELEASE;
rs->sr_err = LDAP_SUCCESS;
rs->sr_err = send_search_entry( op, rs );
+ rs->sr_attrs = NULL;
+ rs->sr_entry = NULL;
/* send_search_entry will usually free it.
* an overlay might leave its own copy here;
OpExtra, oe_next );
}
}
- rs->sr_entry = NULL;
e = NULL;
switch ( rs->sr_err ) {
slap_zn_runlock(bdb->bi_cache.c_zctx, e);
#endif
bdb_cache_return_entry_r( bdb, e , &lock );
+ RS_ASSERT( rs->sr_entry == NULL );
e = NULL;
rs->sr_entry = NULL;
}
done:
(void) ber_free_buf( ber );
}
-
send_search_entry( op, rs );
rs->sr_entry = NULL;
rs->sr_attrs = NULL;
+ rs->sr_flags = 0;
}
entry_clean( &e );
if( urls != NULL ) ber_bvarray_free( urls );
return 0;
}
-
* to be set once for all (correct?) */
li.li_bvuri = bvuri;
for ( ; !BER_BVISNULL( &ref[0] ); ref++ ) {
- SlapReply rs2 = { 0 };
+ SlapReply rs2 = { REP_RESULT };
LDAPURLDesc *srv;
req_search_s save_oq_search = op->oq_search,
tmp_oq_search = { 0 };
} ContinuationReference_t;
#define CR_INIT { NULL, BER_BVNULL, LDAP_DP_RT_UNKNOWN, BER_BVNULL, LDAP_DP_SS_UNKNOWN, NULL, BER_BVNULL }
+#ifdef unused
static struct berval bv2rt[] = {
BER_BVC( "superior" ),
BER_BVC( "subordinate" ),
ber_str2bv( s, 0, 0, &bv );
return ldap_distproc_bv2ss( &bv );
}
+#endif /* unused */
/*
* NOTE: this overlay assumes that the chainingBehavior control
#define ldap_distproc_db_close_one(be) (0)
#define ldap_distproc_db_destroy_one(be, ca) (lback)->bi_db_destroy( (be), (ca) )
-static int
-ldap_distproc_parse_ctrl(
- Operation *op,
- SlapReply *rs,
- LDAPControl *ctrl );
-
static int
ldap_distproc_uri_cmp( const void *c1, const void *c2 )
{
{
int i;
+ RS_ASSERT( !(rs->sr_flags & REP_ENTRY_MASK) );
+ rs->sr_flags &= ~REP_ENTRY_MASK; /* paranoia */
+
for ( i = 0; exop_table[i].extended != NULL; i++ ) {
if ( bvmatch( &exop_table[i].oid, &op->oq_extended.rs_reqoid ) )
{
return rc;
}
-
char **references = NULL;
void *matchctx = NULL;
+ rs_assert_ready( rs );
+ rs->sr_flags &= ~REP_ENTRY_MASK; /* paranoia, we can set rs = non-entry */
+
if ( !ldap_back_dobind( &lc, op, rs, LDAP_BACK_SENDERR ) ) {
return rs->sr_err;
}
rs->sr_ctrls = NULL;
}
rs->sr_entry = NULL;
+ rs->sr_flags = 0;
if ( !BER_BVISNULL( &ent.e_name ) ) {
assert( ent.e_name.bv_val != bdn.bv_val );
op->o_tmpfree( ent.e_name.bv_val, op->o_tmpmemctx );
BER_BVZERO( &rs->sr_ref[ cnt ] );
/* ignore return value by now */
+ RS_ASSERT( !(rs->sr_flags & REP_ENTRY_MASK) );
rs->sr_entry = NULL;
( void )send_search_reference( op, rs );
return rc;
}
-
else if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
rs->sr_entry = e;
rs->sr_attrs = op->ors_attrs;
+ /* Could set REP_ENTRY_MUSTBEFREED too for efficiency,
+ * but refraining lets us test unFREEable MODIFIABLE
+ * entries. Like entries built on the stack.
+ */
rs->sr_flags = REP_ENTRY_MODIFIABLE;
rc = send_search_entry( op, rs );
rs->sr_entry = NULL;
+ rs->sr_attrs = NULL;
}
}
} else if ( candidate == META_TARGET_MULTIPLE ) {
Operation op2 = *op;
- SlapReply rs2 = { 0 };
+ SlapReply rs2 = { REP_RESULT };
slap_callback cb2 = { 0 };
int rc;
done:;
ldap_pvt_thread_mutex_unlock( &mt->mt_quarantine_mutex );
}
-
SlapReply *candidates = NULL;
int do_taint = 0;
+ rs_assert_ready( rs );
+ rs->sr_flags &= ~REP_ENTRY_MASK; /* paranoia, we can set rs = non-entry */
+
/*
* controls are set in ldap_back_dobind()
*
{
monitor_info_t *mi = ( monitor_info_t * ) op->o_bd->be_private;
Entry *e, *matched = NULL;
- Attribute *a;
int rc;
/* get entry with reader lock */
}
rs->sr_err = slap_compare_entry( op, e, op->orc_ava );
-
-return_results:;
rc = rs->sr_err;
switch ( rc ) {
case LDAP_COMPARE_FALSE:
case LDAP_COMPARE_TRUE:
rc = LDAP_SUCCESS;
break;
-
- default:
- break;
}
send_ldap_result( op, rs );
OperationBuffer opbuf;
Operation *op;
void *thrctx;
- SlapReply rs = { 0 };
+ SlapReply rs = { REP_RESULT };
slap_callback cb = { NULL, monitor_search2ndn_cb, NULL, NULL };
int rc;
rs->sr_flags = 0;
rc = send_search_entry( op, rs );
rs->sr_entry = NULL;
+ rs->sr_attrs = NULL;
} else {
rc = 0;
}
rs->sr_attrs = op->ors_attrs;
rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
+ rs->sr_flags = 0;
+ rs->sr_attrs = NULL;
}
entry_clean( &e );
rs->sr_attrs = op->ors_attrs;
rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
+ rs->sr_flags = 0;
+ rs->sr_entry = NULL;
}
entry_clean( &e );
rs->sr_attrs = op->ors_attrs;
rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
+ rs->sr_flags = 0;
+ rs->sr_entry = NULL;
+ rs->sr_attrs = NULL;
}
entry_clean( &e );
rs->sr_flags = REP_ENTRY_MODIFIABLE;
rs->sr_err = LDAP_SUCCESS;
rs->sr_err = send_search_entry( op, rs );
+ rs->sr_flags = 0;
+ rs->sr_attrs = NULL;
+ rs->sr_entry = NULL;
if ( rs->sr_err == LDAP_SIZELIMIT_EXCEEDED ) {
- rs->sr_entry = NULL;
goto done;
}
}
return 0;
}
-
rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
entry_free( rs->sr_entry );
+ rs->sr_attrs = NULL;
}
bp = buf;
rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
entry_free( rs->sr_entry );
+ rs->sr_attrs = NULL;
}
bp = buf;
}
if ( is_at_operational( op->oq_compare.rs_ava->aa_desc->ad_type ) ) {
- SlapReply nrs = { 0 };
+ SlapReply nrs = { REP_SEARCH };
Attribute **ap;
for ( ap = &e.e_attrs; *ap; ap = &(*ap)->a_next )
{
Operation op2 = *op;
slap_callback sc = { 0 };
- SlapReply rs2 = { 0 };
+ SlapReply rs2 = { REP_RESULT };
backsql_tree_delete_t btd = { 0 };
int rc;
#ifdef BACKSQL_SYNCPROV
if ( op->o_sync ) {
Operation op2 = *op;
- SlapReply rs2 = { 0 };
+ SlapReply rs2 = { REP_RESULT };
Entry *e = entry_alloc();
slap_callback cb = { 0 };
a = attr_find( e->e_attrs, entry_at );
if ( a == NULL ) {
- SlapReply rs = { 0 };
+ SlapReply rs = { REP_SEARCH };
AttributeName anlist[ 2 ];
anlist[ 0 ].an_name = entry_at->ad_cname;
* to do no harm to entries */
rs.sr_entry = e;
rc = backend_operational( op, &rs );
- rs.sr_entry = NULL;
-
+
if ( rc == LDAP_SUCCESS ) {
if ( rs.sr_operational_attrs ) {
freeattr = 1;
} else {
a = attr_find( e->e_attrs, entry_at );
if ( a == NULL ) {
- SlapReply rs = { 0 };
+ SlapReply rs = { REP_SEARCH };
AttributeName anlist[ 2 ];
anlist[ 0 ].an_name = entry_at->ad_cname;
* to do no harm to entries */
rs.sr_entry = e;
rc = backend_operational( op, &rs );
- rs.sr_entry = NULL;
if ( rc == LDAP_SUCCESS ) {
if ( rs.sr_operational_attrs ) {
if ( op->o_bd == b0 )
return SLAP_CB_CONTINUE;
- rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
if (op->o_bd && op->o_bd->be_search) {
rs->sr_err = op->o_bd->be_search( op, rs );
+ } else {
+ rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
}
return rs->sr_err;
op->o_tag = LDAP_REQ_ADD;
if ( rc == LDAP_SUCCESS && sc.frontend ) {
+ rs_reinit( &rs, REP_RESULT );
op->ora_e = sc.frontend;
rc = op->o_bd->be_add( op, &rs );
}
if ( rc == LDAP_SUCCESS && sc.config ) {
+ rs_reinit( &rs, REP_RESULT );
op->ora_e = sc.config;
rc = op->o_bd->be_add( op, &rs );
}
out:;
{ int repl = op->o_dont_replicate;
if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
+ rs->sr_text = NULL; /* Set after config_add_internal */
rs->sr_err = LDAP_SUCCESS;
op->o_dont_replicate = 1;
}
out_noop:
if ( rc == LDAP_SUCCESS ) {
attrs_free( save_attrs );
+ rs->sr_text = NULL;
} else {
attrs_free( e->e_attrs );
e->e_attrs = save_attrs;
rdn = ce->ce_entry->e_nname;
ptr = strchr( rdn.bv_val, '=' );
rdn.bv_len = ptr - rdn.bv_val;
- slap_bv2ad( &rdn, &rad, &rs->sr_text );
+ rs->sr_err = slap_bv2ad( &rdn, &rad, &rs->sr_text );
+ if ( rs->sr_err != LDAP_SUCCESS ) {
+ goto out;
+ }
/* Some basic validation... */
for ( ml = op->orm_modlist; ml; ml = ml->sml_next ) {
return 0;
}
+/* currently (2010) does not access rs except possibly writing rs->sr_err */
+
Entry *
config_build_entry( Operation *op, SlapReply *rs, CfEntryInfo *parent,
ConfigArgs *c, struct berval *rdn, ConfigOCs *main, ConfigOCs *extra )
op->ora_modlist = NULL;
slap_add_opattrs( op, NULL, NULL, 0, 0 );
if ( !op->o_noop ) {
- op->o_bd->be_add( op, rs );
- if ( ( rs->sr_err != LDAP_SUCCESS )
- && (rs->sr_err != LDAP_ALREADY_EXISTS) ) {
+ SlapReply rs2 = {REP_RESULT};
+ op->o_bd->be_add( op, &rs2 );
+ rs->sr_err = rs2.sr_err;
+ rs_assert_done( &rs2 );
+ if ( ( rs2.sr_err != LDAP_SUCCESS )
+ && (rs2.sr_err != LDAP_ALREADY_EXISTS) ) {
goto fail;
}
}
/* Create schema nodes for included schema... */
if ( cfb->cb_config->c_kids ) {
+ int rc;
c.depth = 0;
c.ca_private = cfb->cb_config->c_kids;
- if (config_build_schema_inc( &c, ce, op, &rs )) {
+ rc = config_build_schema_inc( &c, ce, op, &rs );
+ if ( rc ) {
return -1;
}
}
return -1;
}
ce = e->e_private;
- if ( be->be_cf_ocs && be->be_cf_ocs->co_cfadd )
+ if ( be->be_cf_ocs && be->be_cf_ocs->co_cfadd ) {
+ rs_reinit( &rs, REP_RESULT );
be->be_cf_ocs->co_cfadd( op, &rs, e, &c );
+ }
/* Iterate through overlays */
if ( oi ) {
slap_overinst *on;
if ( !oe ) {
return -1;
}
- if ( c.bi->bi_cf_ocs && c.bi->bi_cf_ocs->co_cfadd )
+ if ( c.bi->bi_cf_ocs && c.bi->bi_cf_ocs->co_cfadd ) {
+ rs_reinit( &rs, REP_RESULT );
c.bi->bi_cf_ocs->co_cfadd( op, &rs, oe, &c );
+ }
}
}
}
Operation *o, *next, op = {0};
Opheader ohdr = {0};
- SlapReply rs = {0};
op.o_hdr = &ohdr;
op.o_conn = c;
op.o_tag = LDAP_REQ_ABANDON;
for ( o = LDAP_STAILQ_FIRST( &c->c_ops ); o; o=next ) {
+ SlapReply rs = {REP_RESULT};
+
next = LDAP_STAILQ_NEXT( o, o_next );
op.orn_msgid = o->o_msgid;
o->o_abandon = 1;
if ( rs->sr_rspoid != NULL ) {
free( (char *)rs->sr_rspoid );
+ rs->sr_rspoid = NULL;
}
if ( rs->sr_rspdata != NULL ) {
ber_bvfree( rs->sr_rspdata );
+ rs->sr_rspdata = NULL;
}
} /* end of OpenLDAP extended operation */
for (i=0; i<pd.used; i++) {
op->o_req_dn = pd.dn[i];
op->o_req_ndn = pd.ndn[i];
- if ( !slapd_shutdown )
+ if ( !slapd_shutdown ) {
+ rs_reinit( &rs, REP_RESULT );
op->o_bd->be_delete( op, &rs );
+ }
ch_free( pd.ndn[i].bv_val );
ch_free( pd.dn[i].bv_val );
}
{
Modifications mod;
struct berval bv[2];
+ rs_reinit( &rs, REP_RESULT );
/* update context's entryCSN to reflect oldest CSN */
mod.sml_numvals = 1;
mod.sml_values = bv;
* don't modify it directly. Make a copy and
* work with that instead.
*/
- if ( !( rs->sr_flags & REP_ENTRY_MODIFIABLE ) ) {
- Entry *e;
-
- e = entry_dup( rs->sr_entry );
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- rs->sr_flags &= ~REP_ENTRY_MUSTRELEASE;
- } else if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- entry_free( rs->sr_entry );
- }
- rs->sr_entry = e;
- rs->sr_flags |= REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED;
- }
+ rs_ensure_entry_modifiable( op, rs, on );
/* Loop for each attribute in this collectinfo */
for(idx=0; idx<ci->ci_ad_num; idx++) {
}
static int
-constraint_violation( constraint *c, struct berval *bv, Operation *op, SlapReply *rs)
+constraint_violation( constraint *c, struct berval *bv, Operation *op )
{
if ((!c) || (!bv)) return LDAP_SUCCESS;
Operation nop = *op;
slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
slap_callback cb;
- SlapReply nrs = { REP_RESULT };
int i;
- int found;
+ int found = 0;
int rc;
size_t len;
struct berval filterstr;
char *ptr;
- found = 0;
-
- nrs.sr_entry = NULL;
- nrs.sr_nentries = 0;
-
cb.sc_next = NULL;
cb.sc_response = constraint_uri_cb;
cb.sc_cleanup = NULL;
rc = LDAP_OTHER;
} else {
+ SlapReply nrs = { REP_RESULT };
+
Debug(LDAP_DEBUG_TRACE,
"==> constraint_violation uri filter = %s\n",
filterstr.bv_val, 0, 0);
if (!found)
return LDAP_CONSTRAINT_VIOLATION; /* constraint violation */
-
}
return LDAP_SUCCESS;
}
for ( i = 0; b[i].bv_val; i++ ) {
- rc = constraint_violation( cp, &b[i], op, rs );
+ rc = constraint_violation( cp, &b[i], op );
if ( rc ) {
goto add_violation;
}
continue;
for ( i = 0; b[i].bv_val; i++ ) {
- rc = constraint_violation( cp, &b[i], op, rs );
+ rc = constraint_violation( cp, &b[i], op );
if ( rc ) {
goto mod_violation;
}
Attribute *a, *id = NULL;
slap_callback cb;
Operation o = *op;
- SlapReply r = { REP_SEARCH };
struct berval *url;
Entry *e;
int opattrs,
o.o_bd = select_backend( &o.o_req_ndn, 1 );
if ( o.o_bd && o.o_bd->be_search ) {
+ SlapReply r = { REP_SEARCH };
r.sr_attr_flags = slap_attr_flags( o.ors_attrs );
(void)o.o_bd->be_search( &o, &r );
}
memberof_t *mo = (memberof_t *)on->on_bi.bi_private;
Operation op2 = *op;
- SlapReply rs2 = { REP_RESULT };
slap_callback cb = { 0 };
BackendInfo *bi = op->o_bd->bd_info;
AttributeName an[ 2 ];
op2.ors_tlimit = SLAP_NO_LIMIT;
if ( mci->what & MEMBEROF_IS_GROUP ) {
+ SlapReply rs2 = { REP_RESULT };
+
mc.ad = mo->mo_ad_member;
mc.foundit = 0;
mc.vals = NULL;
}
if ( mci->what & MEMBEROF_IS_MEMBER ) {
+ SlapReply rs2 = { REP_RESULT };
+
mc.ad = mo->mo_ad_memberof;
mc.foundit = 0;
mc.vals = NULL;
/*
* response callback that adds memberof values when a group is modified.
*/
-static int
+static void
memberof_value_modify(
Operation *op,
- SlapReply *rs,
struct berval *ndn,
AttributeDescription *ad,
struct berval *old_dn,
* add will fail; better split in two operations, although
* not optimal in terms of performance. At least it would
* move towards self-repairing capabilities. */
-
- return rs2.sr_err;
}
static int
/* the modification is attempted
* with the original identity */
- (void)memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&ma->a_nvals[ i ], mo->mo_ad_member,
NULL, NULL, &op->o_req_dn, &op->o_req_ndn );
}
if ( dn_match( &a->a_nvals[i], &op->o_req_ndn ))
continue;
- (void)memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&a->a_nvals[ i ],
mo->mo_ad_memberof,
NULL, NULL,
vals = mci->member;
if ( vals != NULL ) {
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- (void)memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_memberof,
&op->o_req_dn, &op->o_req_ndn,
NULL, NULL );
vals = mci->memberof;
if ( vals != NULL ) {
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- (void)memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_member,
&op->o_req_dn, &op->o_req_ndn,
NULL, NULL );
case LDAP_MOD_DELETE:
if ( vals != NULL ) {
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_member,
&op->o_req_dn, &op->o_req_ndn,
NULL, NULL );
op->o_bd->bd_info = (BackendInfo *)on;
if ( rc == LDAP_SUCCESS ) {
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- (void)memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_member,
&op->o_req_dn, &op->o_req_ndn,
NULL, NULL );
assert( vals != NULL );
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_member,
NULL, NULL,
&op->o_req_dn, &op->o_req_ndn );
vals = ml->sml_nvalues;
if ( vals != NULL ) {
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_memberof,
&op->o_req_dn, &op->o_req_ndn,
NULL, NULL );
/* delete all ... */
if ( vals != NULL ) {
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- (void)memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_memberof,
&op->o_req_dn, &op->o_req_ndn,
NULL, NULL );
assert( ml->sml_nvalues != NULL );
vals = ml->sml_nvalues;
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_memberof,
NULL, NULL,
&op->o_req_dn, &op->o_req_ndn );
if ( rc == LDAP_SUCCESS ) {
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- (void)memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_memberof,
&op->o_req_dn, &op->o_req_ndn,
&newDN, &newNDN );
if ( rc == LDAP_SUCCESS ) {
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
- (void)memberof_value_modify( op, rs,
+ memberof_value_modify( op,
&vals[ i ], mo->mo_ad_member,
&op->o_req_dn, &op->o_req_ndn,
&newDN, &newNDN );
static int
remove_query_data(
Operation *op,
- SlapReply *rs,
struct berval *query_uuid );
/*
/* ignore expired queries */
if ( expiry_time <= slap_get_time()) {
Operation op2 = *op;
- SlapReply rs2 = { 0 };
memset( &op2.oq_search, 0, sizeof( op2.oq_search ) );
- (void)remove_query_data( &op2, &rs2, &uuid );
+ (void)remove_query_data( &op2, &uuid );
rc = 0;
if ( rc != LDAP_SUCCESS ) {
if ( rc == LDAP_ALREADY_EXISTS ) {
+ rs_reinit( &sreply, REP_RESULT );
slap_entry2mods( e, &modlist, &text, textbuf, textlen );
modlist->sml_op = LDAP_MOD_ADD;
op->o_tag = LDAP_REQ_MODIFY;
static int
remove_query_data(
Operation *op,
- SlapReply *rs,
struct berval *query_uuid )
{
struct query_info *qi, *qnext;
slap_callback cb = { NULL, remove_func, NULL, NULL };
int deleted = 0;
- sreply.sr_entry = NULL;
- sreply.sr_nentries = 0;
op->ors_filterstr.bv_len = snprintf(filter_str, sizeof(filter_str),
"(%s=%s)", ad_queryId->ad_cname.bv_val, query_uuid->bv_val);
filter.f_ava = &ava;
op->o_req_dn = qi->xdn;
op->o_req_ndn = qi->xdn;
+ rs_reinit( &sreply, REP_RESULT );
if ( qi->del ) {
Debug( pcache_debug, "DELETING ENTRY TEMPLATE=%s\n",
static void
remove_query_and_data(
Operation *op,
- SlapReply *rs,
cache_manager *cm,
struct berval *uuid )
{
Debug( pcache_debug,
"Removing query UUID %s\n",
uuid->bv_val, 0, 0 );
- return_val = remove_query_data( op, rs, uuid );
+ return_val = remove_query_data( op, uuid );
Debug( pcache_debug,
"QUERY REMOVED, SIZE=%d\n",
return_val, 0, 0);
}
/* clear entry if required */
- if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- entry_free( rs->sr_entry );
- rs->sr_entry = NULL;
- rs->sr_flags ^= REP_ENTRY_MUSTBEFREED;
- }
+ rs_flush_entry( op, rs, (slap_overinst *) op->o_bd->bd_info );
return rc;
}
OperationBuffer opbuf;
Operation op2;
slap_callback sc = { 0 };
- SlapReply rs = { REP_RESULT };
Filter f = { 0 };
char filtbuf[ LDAP_LUTIL_UUIDSTR_BUFSIZE + STRLENOF( "(entryUUID=)" ) ];
AttributeAssertion ava = ATTRIBUTEASSERTION_INIT;
for ( s = 0; !BER_BVISNULL( &entryUUIDs[ s ] ); s++ ) {
BerVarray vals = NULL;
+ SlapReply rs = { REP_RESULT };
op->ors_filterstr.bv_len = snprintf( filtbuf, sizeof( filtbuf ),
"(entryUUID=%s)", entryUUIDs[ s ].bv_val );
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
struct berval val = vals[ i ];
- remove_query_and_data( op, &rs, cm, &val );
+ remove_query_and_data( op, cm, &val );
if ( !BER_BVISNULL( &val ) && val.bv_val != vals[ i ].bv_val ) {
ch_free( val.bv_val );
struct berval *queryid )
{
Operation op2 = *op;
- SlapReply rs2 = { 0 };
op2.o_bd = &cm->db;
/* remove the selected query */
- remove_query_and_data( &op2, &rs2, cm, queryid );
+ remove_query_and_data( &op2, cm, queryid );
return LDAP_SUCCESS;
}
for ( i = 0; !BER_BVISNULL( &vals[ i ] ); i++ ) {
struct berval val = vals[ i ];
- remove_query_and_data( op, &rs, cm, &val );
+ remove_query_and_data( op, cm, &val );
if ( !BER_BVISNULL( &val ) && val.bv_val != vals[ i ].bv_val ) {
ch_free( val.bv_val );
static int
cache_entries(
Operation *op,
- SlapReply *rs,
struct berval *query_uuid )
{
struct search_info *si = op->o_callback->sc_private;
e->e_private = NULL;
while ( cm->cur_entries > (cm->max_entries) ) {
BER_BVZERO( &crp_uuid );
- remove_query_and_data( op_tmp, rs, cm, &crp_uuid );
+ remove_query_and_data( op_tmp, cm, &crp_uuid );
}
return_val = merge_entry(op_tmp, e, 0, query_uuid);
if ( qc != NULL ) {
switch ( si->caching_reason ) {
case PC_POSITIVE:
- cache_entries( op, rs, &qc->q_uuid );
+ cache_entries( op, &qc->q_uuid );
if ( si->pbi )
si->pbi->bi_cq = qc;
break;
{
int i, len = 0;
struct berval *vals, pres = BER_BVC("*");
- char *p1, *p2, *t1;
+ char *p1, *p2;
Attribute *a;
vals = op->o_tmpalloc( temp->bindnattrs * sizeof( struct berval ),
{
if ( rs->sr_type == REP_SEARCH ) {
refresh_info *ri = op->o_callback->sc_private;
- BackendDB *be = op->o_bd;
Entry *e;
dnlist *dnl;
slap_callback *ocb;
slap_mods_free( modlist, 1 );
/* mods is NULL if there are no changes */
if ( mods ) {
+ SlapReply rs2 = { REP_RESULT };
struct berval dn = op->o_req_dn;
struct berval ndn = op->o_req_ndn;
op->o_tag = LDAP_REQ_MODIFY;
op->o_req_dn = rs->sr_entry->e_name;
op->o_req_ndn = rs->sr_entry->e_nname;
op->o_callback = &cb;
- op->o_bd->be_modify( op, rs );
+ op->o_bd->be_modify( op, &rs2 );
+ rs->sr_err = rs2.sr_err;
+ rs_assert_done( &rs2 );
slap_mods_free( mods, 1 );
op->o_req_dn = dn;
op->o_req_ndn = ndn;
}
static int
-refresh_query( Operation *op, SlapReply *rs, CachedQuery *query,
- slap_overinst *on )
+refresh_query( Operation *op, CachedQuery *query, slap_overinst *on )
{
+ SlapReply rs = {REP_RESULT};
slap_callback cb = { 0 };
refresh_info ri = { 0 };
char filter_str[ LDAP_LUTIL_UUIDSTR_BUFSIZE + STRLENOF( "(pcacheQueryID=)" ) ];
op->ors_attrsonly = 0;
op->o_bd = on->on_info->oi_origdb;
- rc = op->o_bd->be_search( op, rs );
+ rc = op->o_bd->be_search( op, &rs );
if ( rc ) {
op->o_bd = ri.ri_be;
goto leave;
attrs[ 0 ].an_name = ad_queryId->ad_cname;
op->ors_attrs = attrs;
op->ors_attrsonly = 0;
- rs->sr_entry = NULL;
- rs->sr_nentries = 0;
- rc = op->o_bd->be_search( op, rs );
+ rs_reinit( &rs, REP_RESULT );
+ rc = op->o_bd->be_search( op, &rs );
if ( rc ) goto leave;
while (( dn = ri.ri_dels )) {
op->o_req_dn = dn->dn;
op->o_req_ndn = dn->dn;
+ rs_reinit( &rs, REP_RESULT );
if ( dn->delete ) {
op->o_tag = LDAP_REQ_DELETE;
- op->o_bd->be_delete( op, rs );
+ op->o_bd->be_delete( op, &rs );
} else {
Modifications mod;
struct berval vals[2];
op->o_tag = LDAP_REQ_MODIFY;
op->orm_modlist = &mod;
- op->o_bd->be_modify( op, rs );
+ op->o_bd->be_modify( op, &rs );
}
ri.ri_dels = dn->next;
op->o_tmpfree( dn, op->o_tmpmemctx );
OperationBuffer opbuf;
Operation *op;
- SlapReply rs = {REP_RESULT};
CachedQuery *query, *qprev;
int return_val, pause = PCACHE_CC_PAUSED;
QueryTemplate *templ;
if ( query->refcnt )
query->expiry_time = op->o_time + templ->ttl;
if ( query->expiry_time > op->o_time ) {
- refresh_query( op, &rs, query, on );
+ refresh_query( op, query, on );
continue;
}
}
if ( BER_BVISNULL( &query->q_uuid ))
return_val = 0;
else
- return_val = remove_query_data(op, &rs, &query->q_uuid);
+ return_val = remove_query_data(op, &query->q_uuid);
Debug( pcache_debug, "STALE QUERY REMOVED, SIZE=%d\n",
return_val, 0, 0 );
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
OperationBuffer opbuf;
Operation *op;
slap_callback cb = { 0 };
- SlapReply rs = { 0 };
+ SlapReply rs = { REP_RESULT };
BerVarray vals = NULL;
Filter f = { 0 }, f2 = { 0 };
AttributeAssertion ava = ATTRIBUTEASSERTION_INIT;
op->ors_scope = LDAP_SCOPE_SUBTREE;
op->ors_attrs = slap_anlist_no_attrs;
+ rs_reinit( &rs, REP_RESULT );
op->o_callback->sc_response = pcache_cachedquery_count_cb;
- rs.sr_nentries = 0;
op->o_callback->sc_private = &rs.sr_nentries;
rc = op->o_bd->be_search( op, &rs );
static int
refint_repair(
Operation *op,
- SlapReply *rs,
refint_data *id,
refint_q *rq )
{
dependent_data *dp;
+ SlapReply rs = {REP_RESULT};
int rc;
op->o_callback->sc_response = refint_search_cb;
op->o_ndn = op->o_bd->be_rootndn;
/* search */
- rc = op->o_bd->be_search( op, rs );
+ rc = op->o_bd->be_search( op, &rs );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
op2.o_dn = op2.o_bd->be_rootdn;
op2.o_ndn = op2.o_bd->be_rootndn;
slap_op_time( &op2.o_time, &op2.o_tincr );
- if ( ( rc = op2.o_bd->be_modify( &op2, &rs2 ) ) != LDAP_SUCCESS ) {
+ rc = op2.o_bd->be_modify( &op2, &rs2 );
+ if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
"refint_repair: dependent modify failed: %d\n",
rs2.sr_err, 0, 0 );
Connection conn = {0};
OperationBuffer opbuf;
Operation *op;
- SlapReply rs = {REP_RESULT};
slap_callback cb = { NULL, NULL, NULL, NULL };
Filter ftop, *fptr;
refint_q *rq;
if ( rq->db != NULL ) {
op->o_bd = rq->db;
- refint_repair( op, &rs, id, rq );
+ refint_repair( op, id, rq );
} else {
BackendDB *be;
if ( be->be_search && be->be_modify ) {
op->o_bd = be;
- refint_repair( op, &rs, id, rq );
+ refint_repair( op, id, rq );
}
}
}
rs->sr_entry = &rdi->rdi_e;
rs->sr_err = send_search_entry( op, rs );
+ rs->sr_flags = 0;
rs->sr_entry = NULL;
+ rs->sr_attrs = NULL;
switch ( rs->sr_err ) {
case LDAP_UNAVAILABLE: /* connection closed */
}
static rwm_op_cb *
-rwm_callback_get( Operation *op, SlapReply *rs )
+rwm_callback_get( Operation *op )
{
rwm_op_cb *roc;
char *olddn = op->o_req_dn.bv_val;
int isupdate;
- rwm_op_cb *roc = rwm_callback_get( op, rs );
+ rwm_op_cb *roc = rwm_callback_get( op );
rc = rwm_op_dn_massage( op, rs, "addDN", &roc->ros );
if ( rc != LDAP_SUCCESS ) {
slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
int rc;
- rwm_op_cb *roc = rwm_callback_get( op, rs );
+ rwm_op_cb *roc = rwm_callback_get( op );
rc = rwm_op_dn_massage( op, rs, "bindDN", &roc->ros );
if ( rc != LDAP_SUCCESS ) {
int rc;
struct berval mapped_vals[2] = { BER_BVNULL, BER_BVNULL };
- rwm_op_cb *roc = rwm_callback_get( op, rs );
+ rwm_op_cb *roc = rwm_callback_get( op );
rc = rwm_op_dn_massage( op, rs, "compareDN", &roc->ros );
if ( rc != LDAP_SUCCESS ) {
slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
int rc;
- rwm_op_cb *roc = rwm_callback_get( op, rs );
+ rwm_op_cb *roc = rwm_callback_get( op );
rc = rwm_op_dn_massage( op, rs, "deleteDN", &roc->ros );
if ( rc != LDAP_SUCCESS ) {
Modifications **mlp;
int rc;
- rwm_op_cb *roc = rwm_callback_get( op, rs );
+ rwm_op_cb *roc = rwm_callback_get( op );
rc = rwm_op_dn_massage( op, rs, "modifyDN", &roc->ros );
if ( rc != LDAP_SUCCESS ) {
int rc;
dncookie dc;
- rwm_op_cb *roc = rwm_callback_get( op, rs );
+ rwm_op_cb *roc = rwm_callback_get( op );
if ( op->orr_newSup ) {
struct berval nnewSup = BER_BVNULL;
ObjectClass *oc, AttributeDescription *at, int rw, Entry **ep )
{
slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
- struct ldaprwmap *rwmap =
- (struct ldaprwmap *)on->on_bi.bi_private;
-
int rc;
- dncookie dc;
-
BackendDB db;
Operation op2;
SlapReply rs = { REP_SEARCH };
char *text = NULL;
- rwm_op_cb *roc = rwm_callback_get( op, rs );
+ rwm_op_cb *roc = rwm_callback_get( op );
rc = rewrite_session_var_set( rwmap->rwm_rw, op->o_conn,
"searchFilter", op->ors_filterstr.bv_val );
ber_dupbv_x( &op->o_req_ndn, &op->o_ndn, op->o_tmpmemctx );
}
- roc = rwm_callback_get( op, rs );
+ roc = rwm_callback_get( op );
rc = rwm_op_dn_massage( op, rs, "extendedDN", &roc->ros );
if ( rc != LDAP_SUCCESS ) {
}
}
- roc = rwm_callback_get( op, rs );
+ roc = rwm_callback_get( op );
rc = rwm_op_dn_massage( op, rs, "extendedDN", &roc->ros );
if ( rc != LDAP_SUCCESS ) {
return rwm_bva_add( &rwmap->rwm_bva_rewrite, idx, argv );
}
+#ifdef unused
static int
rwm_bva_map_add(
struct ldaprwmap *rwmap,
{
return rwm_bva_add( &rwmap->rwm_bva_map, idx, argv );
}
+#endif /* unused */
static int
rwm_info_init( struct rewrite_info ** rwm_rw )
/* If we didn't find an exact match, then try for <= */
if ( findcsn_retry ) {
findcsn_retry = 0;
+ rs_reinit( &frs, REP_RESULT );
goto again;
}
rc = LDAP_NO_SUCH_OBJECT;
static int
syncprov_sendresp( Operation *op, opcookie *opc, syncops *so, int mode )
{
- slap_overinst *on = opc->son;
-
SlapReply rs = { REP_SEARCH };
LDAPControl *ctrls[2];
struct berval cookie = BER_BVNULL, csns[2];
{
slap_overinst *on = LDAP_SLIST_FIRST(&so->s_op->o_extra)->oe_key;
syncres *sr;
- Entry *e;
opcookie opc;
int rc = 0;
slap_overinst *on = opc->son;
syncprov_info_t *si = on->on_bi.bi_private;
syncmatches *sm, *snext;
- modtarget *mt, mtdummy;
+ modtarget *mt;
ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
if ( si->si_active )
}
static void
-syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on )
+syncprov_checkpoint( Operation *op, slap_overinst *on )
{
syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
Modifications mod;
Operation opm;
- SlapReply rsm = { 0 };
+ SlapReply rsm = {REP_RESULT};
slap_callback cb = {0};
BackendDB be;
BackendInfo *bi;
char txtbuf[SLAP_TEXT_BUFLEN];
size_t textlen = sizeof txtbuf;
Entry *e = slap_create_context_csn_entry( opm.o_bd, NULL );
+ rs_reinit( &rsm, REP_RESULT );
slap_mods2entry( &mod, &e, 0, 1, &text, txtbuf, textlen);
opm.ora_e = e;
opm.o_bd->be_add( &opm, &rsm );
if ( mmods ) {
Operation fop;
- SlapReply frs = { REP_RESULT };
int rc;
Filter mf, af;
AttributeAssertion eq = ATTRIBUTEASSERTION_INIT;
fop.o_bd->bd_info = (BackendInfo *)on->on_info;
for ( i=ndel; i<num; i++ ) {
- if ( uuids[i].bv_len == 0 ) continue;
+ if ( uuids[i].bv_len != 0 ) {
+ SlapReply frs = { REP_RESULT };
mf.f_av_value = uuids[i];
cb.sc_private = NULL;
fop.ors_slimit = 1;
- frs.sr_nentries = 0;
rc = fop.o_bd->be_search( &fop, &frs );
/* If entry was not found, add to delete list */
if ( !cb.sc_private ) {
uuids[ndel++] = uuids[i];
}
+ }
}
fop.o_bd->bd_info = (BackendInfo *)on;
}
if ( do_check ) {
ldap_pvt_thread_rdwr_rlock( &si->si_csn_rwlock );
- syncprov_checkpoint( op, rs, on );
+ syncprov_checkpoint( op, on );
ldap_pvt_thread_rdwr_runlock( &si->si_csn_rwlock );
}
}
if ( !ap ) {
- if ( !(rs->sr_flags & REP_ENTRY_MODIFIABLE) ) {
- Entry *e = entry_dup( rs->sr_entry );
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- } else if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- entry_free( rs->sr_entry );
- }
- rs->sr_entry = e;
- rs->sr_flags |=
- REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED;
+ if ( rs_ensure_entry_modifiable( op, rs, on )) {
a = attr_find( rs->sr_entry->e_attrs,
slap_schema.si_ad_contextCSN );
}
Connection conn = {0};
OperationBuffer opbuf;
Operation *op;
- SlapReply rs = {REP_RESULT};
void *thrctx;
thrctx = ldap_pvt_thread_pool_context();
op->o_bd = be;
op->o_dn = be->be_rootdn;
op->o_ndn = be->be_rootndn;
- syncprov_checkpoint( op, &rs, on );
+ syncprov_checkpoint( op, on );
}
return 0;
}
static int translucent_exop(Operation *op, SlapReply *rs) {
- SlapReply nrs = { REP_RESULT };
-
slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
translucent_info *ov = on->on_bi.bi_private;
const struct berval bv_exop_pwmod = BER_BVC(LDAP_EXOP_MODIFY_PASSWD);
if ( tc->step & USE_LIST ) {
re = tavl_delete( &tc->list, le, entry_dn_cmp );
if ( re ) {
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- }
- if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- rs->sr_flags ^= REP_ENTRY_MUSTBEFREED;
- entry_free( rs->sr_entry );
- }
+ rs_flush_entry( op, rs, on );
rc = test_filter( op, re, tc->orig );
if ( rc == LDAP_COMPARE_TRUE ) {
rs->sr_flags |= REP_ENTRY_MUSTBEFREED;
rc = overlay_entry_get_ov(op, &rs->sr_entry->e_nname, NULL, NULL, 0, &le, on);
if ( rc == LDAP_SUCCESS && le ) {
re = entry_dup( rs->sr_entry );
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- }
- if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- rs->sr_flags ^= REP_ENTRY_MUSTBEFREED;
- entry_free( rs->sr_entry );
- }
+ rs_flush_entry( op, rs, on );
} else {
le = NULL;
}
}
/* Dispose of local entry */
if ( tc->step & LCL_SIDE ) {
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- }
- if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- rs->sr_flags ^= REP_ENTRY_MUSTBEFREED;
- entry_free( rs->sr_entry );
- }
+ rs_flush_entry(op, rs, on);
} else {
overlay_entry_release_ov(op, le, 0, on);
}
av = tavl_next( av, TAVL_DIR_RIGHT );
}
tavl_free( tc.list, NULL );
+ rs->sr_flags = 0;
rs->sr_entry = NULL;
}
send_ldap_result( op, rs );
a = attr_find( rs->sr_entry->e_attrs, vi->vi_ad );
if ( !a ) continue;
- if (( rs->sr_flags & ( REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED ) ) !=
- ( REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED ) )
- {
- Entry *e;
-
- e = entry_dup( rs->sr_entry );
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- overlay_entry_release_ov( op, rs->sr_entry, 0, on );
- rs->sr_flags &= ~REP_ENTRY_MUSTRELEASE;
- } else if ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- entry_free( rs->sr_entry );
- }
- rs->sr_entry = e;
- rs->sr_flags |= REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED;
+ if ( rs_ensure_entry_modifiable( op, rs, on )) {
a = attr_find( rs->sr_entry->e_attrs, vi->vi_ad );
}
/*
* result.c
*/
+#if USE_RS_ASSERT /*defined(USE_RS_ASSERT)?(USE_RS_ASSERT):defined(LDAP_TEST)*/
+#ifdef __GNUC__
+# define RS_FUNC_ __FUNCTION__
+#elif defined(__STDC_VERSION__) && (__STDC_VERSION__) >= 199901L
+# define RS_FUNC_ __func__
+#else
+# define rs_assert_(file, line, func, cond) rs_assert__(file, line, cond)
+#endif
+LDAP_SLAPD_V(int) rs_suppress_assert;
+LDAP_SLAPD_F(void) rs_assert_(const char*, unsigned, const char*, const char*);
+# define RS_ASSERT(cond) ((rs_suppress_assert > 0 || (cond)) \
+ ? (void) 0 : rs_assert_(__FILE__, __LINE__, RS_FUNC_, #cond))
+#else
+# define RS_ASSERT(cond) ((void) 0)
+# define rs_assert_ok(rs) ((void) (rs))
+# define rs_assert_ready(rs) ((void) (rs))
+# define rs_assert_done(rs) ((void) (rs))
+#endif
+LDAP_SLAPD_F (void) (rs_assert_ok) LDAP_P(( const SlapReply *rs ));
+LDAP_SLAPD_F (void) (rs_assert_ready) LDAP_P(( const SlapReply *rs ));
+LDAP_SLAPD_F (void) (rs_assert_done) LDAP_P(( const SlapReply *rs ));
+
+#define rs_reinit(rs, type) do { \
+ SlapReply *const rsRI = (rs); \
+ rs_assert_done( rsRI ); \
+ rsRI->sr_type = (type); \
+ /* Got type before memset in case of rs_reinit(rs, rs->sr_type) */ \
+ assert( !offsetof( SlapReply, sr_type ) ); \
+ memset( (slap_reply_t *) rsRI + 1, 0, \
+ sizeof(*rsRI) - sizeof(slap_reply_t) ); \
+ } while ( 0 )
+LDAP_SLAPD_F (void) (rs_reinit) LDAP_P(( SlapReply *rs, slap_reply_t type ));
+LDAP_SLAPD_F (void) rs_flush_entry LDAP_P(( Operation *op,
+ SlapReply *rs, slap_overinst *on ));
LDAP_SLAPD_F (void) rs_replace_entry LDAP_P(( Operation *op,
SlapReply *rs, slap_overinst *on, Entry *e ));
LDAP_SLAPD_F (int) rs_ensure_entry_modifiable LDAP_P(( Operation *op,
LDAP_END_DECL
#endif /* PROTO_SLAP_H */
-
return tag;
}
-#ifdef RS_ASSERT
-#elif 0 && defined LDAP_DEVEL /* FIXME: this should not crash. ITS#5340. */
-#define RS_ASSERT assert
+/* SlapReply debugging, prodo-slap.h overrides it in OpenLDAP releases */
+#if defined(LDAP_TEST) || (defined(USE_RS_ASSERT) && (USE_RS_ASSERT))
+
+int rs_suppress_assert = 0;
+
+/* RS_ASSERT() helper function */
+void rs_assert_(const char*file, unsigned line, const char*fn, const char*cond)
+{
+ int no_assert = rs_suppress_assert, save_errno = errno;
+ const char *s;
+
+ if ( no_assert >= 0 ) {
+ if ( no_assert == 0 && (s = getenv( "NO_RS_ASSERT" )) && *s ) {
+ no_assert = rs_suppress_assert = atoi( s );
+ }
+ if ( no_assert > 0 ) {
+ errno = save_errno;
+ return;
+ }
+ }
+
+#ifdef rs_assert_ /* proto-slap.h #defined away the fn parameter */
+ fprintf( stderr,"%s:%u: " "RS_ASSERT(%s) failed.\n", file,line,cond );
#else
-#define RS_ASSERT(cond) ((void) 0)
+ fprintf( stderr,"%s:%u: %s: RS_ASSERT(%s) failed.\n", file,line,fn,cond );
#endif
+ fflush( stderr );
+
+ errno = save_errno;
+ /* $NO_RS_ASSERT > 0: ignore rs_asserts, 0: abort, < 0: just warn */
+ if ( !no_assert /* from $NO_RS_ASSERT */ ) abort();
+}
-/* Set rs->sr_entry after obyeing and clearing sr_flags & REP_ENTRY_MASK. */
+/* SlapReply is consistent */
void
-rs_replace_entry( Operation *op, SlapReply *rs, slap_overinst *on, Entry *e )
+(rs_assert_ok)( const SlapReply *rs )
+{
+ const slap_mask_t flags = rs->sr_flags;
+
+ if ( flags & REP_ENTRY_MASK ) {
+ RS_ASSERT( !(flags & REP_ENTRY_MUSTRELEASE)
+ || !(flags & (REP_ENTRY_MASK ^ REP_ENTRY_MUSTRELEASE)) );
+ RS_ASSERT( rs->sr_entry != NULL );
+ RS_ASSERT( (1 << rs->sr_type) &
+ ((1 << REP_SEARCH) | (1 << REP_SEARCHREF) |
+ (1 << REP_RESULT) | (1 << REP_GLUE_RESULT)) );
+ }
+#if defined(USE_RS_ASSERT) && (USE_RS_ASSERT) > 1 /* TODO: Enable when safe */
+ if ( (flags & (REP_MATCHED_MASK | REP_REF_MASK | REP_CTRLS_MASK)) ) {
+ RS_ASSERT( !(flags & REP_MATCHED_MASK) || rs->sr_matched );
+ RS_ASSERT( !(flags & REP_CTRLS_MASK ) || rs->sr_ctrls );
+ /* Note: LDAP_REFERRAL + !sr_ref is OK, becomes LDAP_NO_SUCH_OBJECT */
+ }
+#if (USE_RS_ASSERT) > 2
+ if ( rs->sr_err == LDAP_SUCCESS ) {
+ RS_ASSERT( rs->sr_text == NULL );
+ RS_ASSERT( rs->sr_matched == NULL );
+ }
+#endif
+#endif
+}
+
+/* Ready for calling a new backend operation */
+void
+(rs_assert_ready)( const SlapReply *rs )
+{
+ RS_ASSERT( !rs->sr_entry );
+#if defined(USE_RS_ASSERT) && (USE_RS_ASSERT) > 1 /* TODO: Enable when safe */
+ RS_ASSERT( !rs->sr_text );
+ RS_ASSERT( !rs->sr_ref );
+ RS_ASSERT( !rs->sr_matched );
+ RS_ASSERT( !rs->sr_ctrls );
+ RS_ASSERT( !rs->sr_flags );
+#if (USE_RS_ASSERT) > 2
+ RS_ASSERT( rs->sr_err == LDAP_SUCCESS );
+#endif
+#else
+ RS_ASSERT( !(rs->sr_flags & REP_ENTRY_MASK) );
+#endif
+}
+
+/* Backend operation done */
+void
+(rs_assert_done)( const SlapReply *rs )
{
- slap_mask_t e_flags = rs->sr_flags & REP_ENTRY_MUSTFLUSH;
+#if defined(USE_RS_ASSERT) && (USE_RS_ASSERT) > 1 /* TODO: Enable when safe */
+ RS_ASSERT( !(rs->sr_flags & ~(REP_ENTRY_MODIFIABLE|REP_NO_OPERATIONALS)) );
+ rs_assert_ok( rs );
+#else
+ RS_ASSERT( !(rs->sr_flags & REP_ENTRY_MUSTFLUSH) );
+#endif
+}
- if ( e_flags && rs->sr_entry != NULL ) {
- RS_ASSERT( e_flags != REP_ENTRY_MUSTFLUSH );
- if ( !(e_flags & REP_ENTRY_MUSTRELEASE) ) {
+#endif /* LDAP_TEST || USE_RS_ASSERT */
+
+/* Reset a used SlapReply whose contents has been flushed (freed/released) */
+void
+(rs_reinit)( SlapReply *rs, slap_reply_t type )
+{
+ rs_reinit( rs, type ); /* proto-slap.h macro */
+}
+
+/* Obey and clear rs->sr_flags & REP_ENTRY_MASK. Clear sr_entry if freed. */
+void
+rs_flush_entry( Operation *op, SlapReply *rs, slap_overinst *on )
+{
+ rs_assert_ok( rs );
+
+ if ( (rs->sr_flags & REP_ENTRY_MUSTFLUSH) && rs->sr_entry != NULL ) {
+ if ( !(rs->sr_flags & REP_ENTRY_MUSTRELEASE) ) {
entry_free( rs->sr_entry );
} else if ( on != NULL ) {
overlay_entry_release_ov( op, rs->sr_entry, 0, on );
} else {
be_entry_release_rw( op, rs->sr_entry, 0 );
}
+ rs->sr_entry = NULL;
}
+
rs->sr_flags &= ~REP_ENTRY_MASK;
+}
+
+/* Set rs->sr_entry after obeying and clearing sr_flags & REP_ENTRY_MASK. */
+void
+rs_replace_entry( Operation *op, SlapReply *rs, slap_overinst *on, Entry *e )
+{
+ rs_flush_entry( op, rs, on );
rs->sr_entry = e;
}
rs_ensure_entry_modifiable( Operation *op, SlapReply *rs, slap_overinst *on )
{
if ( rs->sr_flags & REP_ENTRY_MODIFIABLE ) {
- RS_ASSERT((rs->sr_flags & REP_ENTRY_MUSTFLUSH)==REP_ENTRY_MUSTBEFREED);
+ rs_assert_ok( rs );
return 0;
}
rs_replace_entry( op, rs, on, entry_dup( rs->sr_entry ));
rs->sr_err, rs->sr_text ? rs->sr_text : "", NULL );
assert( LDAP_UNSOLICITED_ERROR( rs->sr_err ) );
+ /* TODO: Flush the entry if sr_type == REP_SEARCH/REP_SEARCHREF? */
+ RS_ASSERT( !(rs->sr_flags & REP_ENTRY_MASK) );
+ rs->sr_flags &= ~REP_ENTRY_MASK; /* paranoia */
+
rs->sr_type = REP_EXTENDED;
rs->sr_rspdata = NULL;
rs->sr_err,
rs->sr_sasldata ? (long) rs->sr_sasldata->bv_len : -1, NULL );
+ RS_ASSERT( !(rs->sr_flags & REP_ENTRY_MASK) );
+ rs->sr_flags &= ~REP_ENTRY_MASK; /* paranoia */
+
rs->sr_type = REP_SASL;
rs->sr_tag = slap_req2res( op->o_tag );
rs->sr_msgid = (rs->sr_tag != LBER_SEQUENCE) ? op->o_msgid : 0;
rs->sr_rspoid ? rs->sr_rspoid : "",
rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 );
+ RS_ASSERT( !(rs->sr_flags & REP_ENTRY_MASK) );
+ rs->sr_flags &= ~REP_ENTRY_MASK; /* paranoia */
+
rs->sr_type = REP_EXTENDED;
rs->sr_tag = slap_req2res( op->o_tag );
rs->sr_msgid = (rs->sr_tag != LBER_SEQUENCE) ? op->o_msgid : 0;
rs->sr_rspoid ? rs->sr_rspoid : "",
rs->sr_rspdata != NULL ? rs->sr_rspdata->bv_len : 0 );
+ RS_ASSERT( !(rs->sr_flags & REP_ENTRY_MASK) );
+ rs->sr_flags &= ~REP_ENTRY_MASK; /* paranoia */
+
rs->sr_type = REP_INTERMEDIATE;
rs->sr_tag = LDAP_RES_INTERMEDIATE;
rs->sr_msgid = op->o_msgid;
Statslog( LDAP_DEBUG_STATS2, "%s ENTRY dn=\"%s\"\n",
op->o_log_prefix, rs->sr_entry->e_nname.bv_val, 0, 0, 0 );
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- be_entry_release_rw( op, rs->sr_entry, 0 );
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- rs->sr_entry = NULL;
- }
+ rs_flush_entry( op, rs, NULL );
if ( op->o_res_ber == NULL ) {
bytes = send_ldap_ber( op, ber );
slap_sl_free( e_flags, op->o_tmpmemctx );
}
+ /* FIXME: Can break if rs now contains an extended response */
if ( rs->sr_operational_attrs ) {
attrs_free( rs->sr_operational_attrs );
rs->sr_operational_attrs = NULL;
}
rs->sr_attr_flags = SLAP_ATTRS_UNDEFINED;
- /* FIXME: I think rs->sr_type should be explicitly set to
- * REP_SEARCH here. That's what it was when we entered this
- * function. send_ldap_error may have changed it, but we
- * should set it back so that the cleanup functions know
- * what they're doing.
- */
- if ( op->o_tag == LDAP_REQ_SEARCH && rs->sr_type == REP_SEARCH
- && rs->sr_entry
- && ( rs->sr_flags & REP_ENTRY_MUSTBEFREED ) )
- {
- entry_free( rs->sr_entry );
- rs->sr_entry = NULL;
- rs->sr_flags &= ~REP_ENTRY_MUSTBEFREED;
+ if ( op->o_tag == LDAP_REQ_SEARCH && rs->sr_type == REP_SEARCH ) {
+ rs_flush_entry( op, rs, NULL );
+ } else {
+ RS_ASSERT( (rs->sr_flags & REP_ENTRY_MASK) == 0 );
}
if ( rs->sr_flags & REP_CTRLS_MUSTBEFREED ) {
}
rc = 0;
- if ( rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- assert( rs->sr_entry != NULL );
- be_entry_release_rw( op, rs->sr_entry, 0 );
- rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- rs->sr_entry = NULL;
- }
+ rs_flush_entry( op, rs, NULL );
#ifdef LDAP_CONNECTIONLESS
if (!op->o_conn || op->o_conn->c_is_udp == 0) {
rep_extended_s sru_extended;
} sr_un;
slap_mask_t sr_flags;
-#define REP_ENTRY_MODIFIABLE 0x0001U
-#define REP_ENTRY_MUSTBEFREED 0x0002U
-#define REP_ENTRY_MUSTRELEASE 0x0004U
-#define REP_ENTRY_MASK (REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED|REP_ENTRY_MUSTRELEASE)
+#define REP_ENTRY_MODIFIABLE ((slap_mask_t) 0x0001U)
+#define REP_ENTRY_MUSTBEFREED ((slap_mask_t) 0x0002U)
+#define REP_ENTRY_MUSTRELEASE ((slap_mask_t) 0x0004U)
+#define REP_ENTRY_MASK (REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTFLUSH)
#define REP_ENTRY_MUSTFLUSH (REP_ENTRY_MUSTBEFREED|REP_ENTRY_MUSTRELEASE)
-#define REP_MATCHED_MUSTBEFREED 0x0010U
+#define REP_MATCHED_MUSTBEFREED ((slap_mask_t) 0x0010U)
#define REP_MATCHED_MASK (REP_MATCHED_MUSTBEFREED)
-#define REP_REF_MUSTBEFREED 0x0020U
+#define REP_REF_MUSTBEFREED ((slap_mask_t) 0x0020U)
#define REP_REF_MASK (REP_REF_MUSTBEFREED)
-#define REP_CTRLS_MUSTBEFREED 0x0040U
+#define REP_CTRLS_MUSTBEFREED ((slap_mask_t) 0x0040U)
#define REP_CTRLS_MASK (REP_CTRLS_MUSTBEFREED)
-#define REP_NO_ENTRYDN 0x1000U
-#define REP_NO_SUBSCHEMA 0x2000U
+#define REP_NO_ENTRYDN ((slap_mask_t) 0x1000U)
+#define REP_NO_SUBSCHEMA ((slap_mask_t) 0x2000U)
#define REP_NO_OPERATIONALS (REP_NO_ENTRYDN|REP_NO_SUBSCHEMA)
};
break;
case SLAPI_SEARCH_RESULT_ENTRY:
PBLOCK_ASSERT_OP( pb, 0 );
- if ( pb->pb_rs->sr_flags & REP_ENTRY_MUSTBEFREED ) {
- entry_free( pb->pb_rs->sr_entry );
- } else if ( pb->pb_rs->sr_flags & REP_ENTRY_MUSTRELEASE ) {
- be_entry_release_r( pb->pb_op, pb->pb_rs->sr_entry );
- pb->pb_rs->sr_flags ^= REP_ENTRY_MUSTRELEASE;
- }
- pb->pb_rs->sr_entry = (Slapi_Entry *)value;
+ rs_replace_entry( pb->pb_op, pb->pb_rs, NULL, (Slapi_Entry *)value );
+ /* TODO: Should REP_ENTRY_MODIFIABLE be set? */
pb->pb_rs->sr_flags |= REP_ENTRY_MUSTBEFREED;
break;
case SLAPI_BIND_RET_SASLCREDS:
}
#endif /* LDAP_SLAPI */
-
AttributeName at[2];
Attribute a = {0};
Entry e = {0};
- SlapReply rs = {0};
+ SlapReply rs = {REP_SEARCH};
int i, j, changed = 0;
/* Look for contextCSN from syncprov overlay. If
struct berval syncUUID_strrep = BER_BVNULL;
SlapReply rs_search = {REP_RESULT};
- SlapReply rs_delete = {REP_RESULT};
- SlapReply rs_add = {REP_RESULT};
- SlapReply rs_modify = {REP_RESULT};
Filter f = {0};
AttributeAssertion ava = ATTRIBUTEASSERTION_INIT;
int rc = LDAP_SUCCESS;
}
retry_add:;
if ( BER_BVISNULL( &dni.dn ) ) {
+ SlapReply rs_add = {REP_RESULT};
op->o_req_dn = entry->e_name;
op->o_req_ndn = entry->e_nname;
case LDAP_ALREADY_EXISTS:
if ( retry ) {
Operation op2 = *op;
- SlapReply rs2 = { 0 };
+ SlapReply rs2 = { REP_RESULT };
slap_callback cb2 = { 0 };
op2.o_bd = be;
struct berval noldp, newp;
Modifications *mod, **modtail, **ml, *m2;
int i, got_replace = 0, just_rename = 0;
+ SlapReply rs_modify = {REP_RESULT};
op->o_tag = LDAP_REQ_MODRDN;
dnRdn( &entry->e_name, &op->orr_newrdn );
}
op->o_bd = si->si_wbe;
retry_modrdn:;
+ rs_reinit( &rs_modify, REP_RESULT );
rc = op->o_bd->be_modrdn( op, &rs_modify );
/* NOTE: noSuchObject should result because the new superior
slap_queue_csn( op, syncCSN );
}
if ( dni.mods ) {
+ SlapReply rs_modify = {REP_RESULT};
+
op->o_tag = LDAP_REQ_MODIFY;
op->orm_modlist = dni.mods;
op->orm_no_opattrs = 1;
goto done;
case LDAP_SYNC_DELETE :
if ( !BER_BVISNULL( &dni.dn ) ) {
+ SlapReply rs_delete = {REP_RESULT};
op->o_req_dn = dni.dn;
op->o_req_ndn = dni.ndn;
op->o_tag = LDAP_REQ_DELETE;
op->o_req_dn = pdn;
op->o_req_ndn = pdn;
op->o_callback = &cb;
+ rs_reinit( &rs_delete, REP_RESULT );
op->o_bd->be_delete( op, &rs_delete );
} else {
break;
{
Backend* be = op->o_bd;
slap_callback cb = { NULL };
- SlapReply rs_search = {REP_RESULT};
- SlapReply rs_delete = {REP_RESULT};
- SlapReply rs_modify = {REP_RESULT};
struct nonpresent_entry *np_list, *np_prev;
int rc;
AttributeName an[2];
si->si_refreshDelete |= NP_DELETE_ONE;
for (i=0; uuids[i].bv_val; i++) {
+ SlapReply rs_search = {REP_RESULT};
+
op->ors_slimit = 1;
uf.f_av_value = uuids[i];
filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
Filter *cf, *of;
Filter mmf[2];
AttributeAssertion mmaa;
+ SlapReply rs_search = {REP_RESULT};
memset( &an[0], 0, 2 * sizeof( AttributeName ) );
an[0].an_name = slap_schema.si_ad_entryUUID->ad_cname;
np_list = LDAP_LIST_FIRST( &si->si_nonpresentlist );
while ( np_list != NULL ) {
+ SlapReply rs_delete = {REP_RESULT};
+
LDAP_LIST_REMOVE( np_list, npe_link );
np_prev = np_list;
np_list = LDAP_LIST_NEXT( np_list, npe_link );
si->si_ridtxt, op->o_req_dn.bv_val, rc );
if ( rs_delete.sr_err == LDAP_NOT_ALLOWED_ON_NONLEAF ) {
+ SlapReply rs_modify = {REP_RESULT};
Modifications mod1, mod2;
mod1.sml_op = LDAP_MOD_REPLACE;
mod1.sml_flags = 0;
op->o_req_dn = pdn;
op->o_req_ndn = pdn;
op->o_callback = &cb;
+ rs_reinit( &rs_delete, REP_RESULT );
/* give it a root privil ? */
op->o_bd->be_delete( op, &rs_delete );
} else {
struct berval dn = BER_BVNULL;
struct berval ndn = BER_BVNULL;
Entry *glue;
- SlapReply rs_add = {REP_RESULT};
struct berval ptr, nptr;
char *comma;
}
while ( ndn.bv_val > e->e_nname.bv_val ) {
+ SlapReply rs_add = {REP_RESULT};
+
glue = entry_alloc();
ber_dupbv( &glue->e_name, &dn );
ber_dupbv( &glue->e_nname, &ndn );
char txtbuf[SLAP_TEXT_BUFLEN];
size_t textlen = sizeof txtbuf;
Entry *e = slap_create_context_csn_entry( op->o_bd, NULL );
+ rs_reinit( &rs_modify, REP_RESULT );
rc = slap_mods2entry( &mod, &e, 0, 1, &text, txtbuf, textlen);
op->ora_e = e;
rc = op->o_bd->be_add( op, &rs_modify );
* in the provider are always propagated.
*/
if ( dni->new_entry ) {
- Modifications **modtail, **ml;
Attribute *old, *new;
struct berval old_rdn, new_rdn;
struct berval old_p, new_p;