goto retry;
case DB_NOTFOUND:
if ( BER_BVISEMPTY( &op->o_req_ndn )) {
- struct berval ocbva[] = {
- BER_BVC("locality"),
- BER_BVC("syncProviderSubentry"),
- BER_BVNULL
- };
+ struct berval gluebv = BER_BVC("glue");
e = ch_calloc( 1, sizeof(Entry));
e->e_name.bv_val = ch_strdup( "" );
ber_dupbv( &e->e_nname, &e->e_name );
- attr_merge( e, slap_schema.si_ad_objectClass, ocbva, NULL );
+ attr_merge_one( e, slap_schema.si_ad_objectClass,
+ &gluebv, NULL );
attr_merge_one( e, slap_schema.si_ad_structuralObjectClass,
- &ocbva[0], NULL );
+ &gluebv, NULL );
e->e_private = ei;
fakeroot = 1;
rs->sr_err = 0;
return ei.bei_id;
}
-static struct berval ocbva[] = {
- BER_BVC("locality"),
- BER_BVC("syncProviderSubentry"),
- BER_BVNULL
-};
-
int bdb_tool_id2entry_get(
Backend *be,
ID id,
if ( rc == DB_NOTFOUND && id == 0 ) {
Entry *dummy = ch_calloc( 1, sizeof(Entry) );
+ struct berval gluebv = BER_BVC("glue");
dummy->e_name.bv_val = ch_strdup( "" );
dummy->e_nname.bv_val = ch_strdup( "" );
- attr_merge( dummy, slap_schema.si_ad_objectClass, ocbva, NULL );
+ attr_merge_one( dummy, slap_schema.si_ad_objectClass, &gluebv, NULL );
attr_merge_one( dummy, slap_schema.si_ad_structuralObjectClass,
- &ocbva[0], NULL );
+ &gluebv, NULL );
*e = dummy;
rc = LDAP_SUCCESS;
}
return LDAP_SUCCESS;
}
-#if 0
-/* Generate state based on session log - not implemented yet */
-static int
-syncprov_state_ctrl_from_slog(
- Operation *op,
- SlapReply *rs,
- struct slog_entry *slog_e,
- int entry_sync_state,
- LDAPControl **ctrls,
- int num_ctrls,
- int send_cookie,
- struct berval *cookie)
-{
- Attribute* a;
- int ret;
- int res;
- const char *text = NULL;
-
- BerElementBuffer berbuf;
- BerElement *ber = (BerElement *)&berbuf;
-
- struct berval entryuuid_bv = BER_BVNULL;
-
- ber_init2( ber, NULL, LBER_USE_DER );
- ber_set_option( ber, LBER_OPT_BER_MEMCTX, &op->o_tmpmemctx );
-
- ctrls[num_ctrls] = ch_malloc ( sizeof ( LDAPControl ) );
-
- entryuuid_bv = slog_e->sl_uuid;
-
- if ( send_cookie && cookie ) {
- ber_printf( ber, "{eOON}",
- entry_sync_state, &entryuuid_bv, cookie );
- } else {
- ber_printf( ber, "{eON}",
- entry_sync_state, &entryuuid_bv );
- }
-
- ctrls[num_ctrls]->ldctl_oid = LDAP_CONTROL_SYNC_STATE;
- ctrls[num_ctrls]->ldctl_iscritical = (op->o_sync == SLAP_CONTROL_CRITICAL);
- ret = ber_flatten2( ber, &ctrls[num_ctrls]->ldctl_value, 1 );
-
- ber_free_buf( ber );
-
- if ( ret < 0 ) {
- Debug( LDAP_DEBUG_TRACE,
- "slap_build_sync_ctrl: ber_flatten2 failed\n",
- 0, 0, 0 );
- send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
- return ret;
- }
-
- return LDAP_SUCCESS;
-}
-#endif
-
static int
syncprov_sendinfo(
Operation *op,
cb.sc_private = fc;
fop.o_sync_mode &= SLAP_CONTROL_MASK; /* turn off sync mode */
+ fop.o_managedsait = SLAP_CONTROL_CRITICAL;
fop.o_callback = &cb;
fop.o_tag = LDAP_REQ_SEARCH;
fop.ors_scope = LDAP_SCOPE_BASE;
fop = *op;
fop.o_sync_mode &= SLAP_CONTROL_MASK; /* turn off sync_mode */
+ /* We want pure entries, not referrals */
+ fop.o_managedsait = SLAP_CONTROL_CRITICAL;
fbuf.bv_val = buf;
cf.f_ava = &eq;
fop.ors_attrsonly = 0;
fop.ors_attrs = uuid_anlist;
fop.ors_slimit = SLAP_NO_LIMIT;
- /* We want pure entries, not referrals */
- fop.o_managedsait = SLAP_CONTROL_CRITICAL;
cb.sc_private = &pcookie;
cb.sc_response = findpres_cb;
pcookie.num = 0;
Modifications mod;
Operation opm;
struct berval bv[2];
- BackendInfo *orig;
slap_callback cb = {0};
+ int manage = get_manageDSAit(op);
mod.sml_values = bv;
bv[1].bv_val = NULL;
opm.orm_modlist = &mod;
opm.o_req_dn = op->o_bd->be_suffix[0];
opm.o_req_ndn = op->o_bd->be_nsuffix[0];
- orig = opm.o_bd->bd_info;
opm.o_bd->bd_info = on->on_info->oi_orig;
+ opm.o_managedsait = SLAP_CONTROL_NONCRITICAL;
opm.o_bd->be_modify( &opm, rs );
+ opm.o_managedsait = manage;
}
static void
}
srs = op->o_controls[slap_cids.sc_LDAPsync];
+ op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
/* If this is a persistent search, set it up right away */
if ( op->o_sync_mode & SLAP_SYNC_PERSIST ) {