/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2002-2005 The OpenLDAP Foundation.
+ * Copyright 2002-2012 The OpenLDAP Foundation.
* Portions Copyright 1997,2002-2003 IBM Corporation.
* All rights reserved.
*
#ifdef LDAP_SLAPI
-static struct slap_listener slapi_listener = {
+static struct Listener slapi_listener = {
BER_BVC("slapi://"),
BER_BVC("slapi://")
};
LDAPControl **c;
int rc = LDAP_SUCCESS;
- if ( pb->pop->o_ctrls != NULL ) {
- for ( c = pb->pop->o_ctrls; *c != NULL; c++ ) {
- rc = slap_parse_ctrl( pb->pop, &pb->rs, *c, &pb->rs.sr_text );
+ if ( pb->pb_op->o_ctrls != NULL ) {
+ for ( c = pb->pb_op->o_ctrls; *c != NULL; c++ ) {
+ rc = slap_parse_ctrl( pb->pb_op, pb->pb_rs, *c, &pb->pb_rs->sr_text );
if ( rc != LDAP_SUCCESS )
break;
}
LDAP_STAILQ_INIT( &conn->c_pending_ops );
- op = (Operation *) slapi_ch_calloc( 1, OPERATION_BUFFER_SIZE );
- op->o_hdr = (Opheader *)(op + 1);
- op->o_hdr->oh_extensions = NULL;
- op->o_controls = (void **)(op->o_hdr + 1);
+ op = (Operation *) slapi_ch_calloc( 1, sizeof(OperationBuffer) );
+ op->o_hdr = &((OperationBuffer *) op)->ob_hdr;
+ op->o_controls = ((OperationBuffer *) op)->ob_controls;
op->o_callback = (slap_callback *) slapi_ch_calloc( 1, sizeof(slap_callback) );
op->o_callback->sc_response = slapi_int_response;
/* should check status of thread calls */
ldap_pvt_thread_mutex_init( &conn->c_mutex );
- ldap_pvt_thread_mutex_init( &conn->c_write_mutex );
- ldap_pvt_thread_cond_init( &conn->c_write_cv );
+ ldap_pvt_thread_mutex_init( &conn->c_write1_mutex );
+ ldap_pvt_thread_mutex_init( &conn->c_write2_mutex );
+ ldap_pvt_thread_cond_init( &conn->c_write1_cv );
+ ldap_pvt_thread_cond_init( &conn->c_write2_cv );
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
conn->c_conn_state = 0x01; /* SLAP_C_ACTIVE */
conn->c_struct_state = 0x02; /* SLAP_C_USED */
- conn->c_ssf = conn->c_transport_ssf = 0;
+ conn->c_ssf = conn->c_transport_ssf = local_ssf;
conn->c_tls_ssf = 0;
backend_connection_init( conn );
op->o_connid = conn->c_connid;
op->o_bd = frontendDB;
- pb->pop = op;
- pb->pconn = conn;
- pb->internal_op = 1;
+ /* extensions */
+ slapi_int_create_object_extensions( SLAPI_X_EXT_OPERATION, op );
+ slapi_int_create_object_extensions( SLAPI_X_EXT_CONNECTION, conn );
+
+ pb->pb_rs = (SlapReply *)slapi_ch_calloc( 1, sizeof(SlapReply) );
+ pb->pb_op = op;
+ pb->pb_conn = conn;
+ pb->pb_intop = 1;
ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
}
slapi_int_set_operation_dn( Slapi_PBlock *pb )
{
Backend *be;
- Operation *op = pb->pop;
+ Operation *op = pb->pb_op;
if ( BER_BVISNULL( &op->o_ndn ) ) {
/* set to root DN */
- be = select_backend( &op->o_req_ndn, 0, 0 );
- assert( be != NULL );
- ber_dupbv( &op->o_dn, &be->be_rootdn );
- ber_dupbv( &op->o_ndn, &be->be_rootndn );
+ be = select_backend( &op->o_req_ndn, 1 );
+ if ( be != NULL ) {
+ ber_dupbv( &op->o_dn, &be->be_rootdn );
+ ber_dupbv( &op->o_ndn, &be->be_rootndn );
+ }
}
}
PBLOCK_ASSERT_INTOP( pb, 0 );
- conn = pb->pconn;
- op = pb->pop;
+ conn = pb->pb_conn;
+ op = pb->pb_op;
/* free allocated DNs */
if ( !BER_BVISNULL( &op->o_dn ) )
op->o_tmpfree( op->orr_nnewSup->bv_val, op->o_tmpmemctx );
op->o_tmpfree( op->orr_nnewSup, op->o_tmpmemctx );
}
+ slap_mods_free( op->orr_modlist, 1 );
break;
case LDAP_REQ_ADD:
- slapi_int_mods_free( op->ora_modlist );
+ slap_mods_free( op->ora_modlist, 0 );
break;
case LDAP_REQ_MODIFY:
- slapi_int_mods_free( op->orm_modlist );
+ slap_mods_free( op->orm_modlist, 1 );
break;
case LDAP_REQ_SEARCH:
if ( op->ors_attrs != NULL ) {
slapi_ch_free_string( &conn->c_authmech.bv_val );
slapi_ch_free_string( &conn->c_dn.bv_val );
slapi_ch_free_string( &conn->c_ndn.bv_val );
+ slapi_ch_free_string( &conn->c_peer_domain.bv_val );
+ slapi_ch_free_string( &conn->c_peer_name.bv_val );
if ( conn->c_sb != NULL ) {
ber_sockbuf_free( conn->c_sb );
}
- slapi_ch_free( (void **)&pb->pop->o_callback );
- slapi_ch_free( (void **)&pb->pop );
- slapi_ch_free( (void **)&pb->pconn );
+ slapi_int_free_object_extensions( SLAPI_X_EXT_OPERATION, op );
+ slapi_int_free_object_extensions( SLAPI_X_EXT_CONNECTION, conn );
+
+ slapi_ch_free( (void **)&pb->pb_op->o_callback );
+ slapi_ch_free( (void **)&pb->pb_op );
+ slapi_ch_free( (void **)&pb->pb_conn );
+ slapi_ch_free( (void **)&pb->pb_rs );
}
static int
slapi_int_func_internal_pb( Slapi_PBlock *pb, slap_operation_t which )
{
BI_op_bind **func;
- SlapReply *rs = &pb->rs;
+ SlapReply *rs = pb->pb_rs;
+ int rc;
PBLOCK_ASSERT_INTOP( pb, 0 );
- rs->sr_err = slapi_int_get_ctrls( pb );
- if ( rs->sr_err != LDAP_SUCCESS ) {
- return rs->sr_err;
+ rc = slapi_int_get_ctrls( pb );
+ if ( rc != LDAP_SUCCESS ) {
+ rs->sr_err = rc;
+ return rc;
}
- func = &pb->pop->o_bd->be_bind;
+ pb->pb_op->o_bd = frontendDB;
+ func = &frontendDB->be_bind;
- rs->sr_err = func[which]( pb->pop, &pb->rs );
-
- return rs->sr_err;
+ return func[which]( pb->pb_op, pb->pb_rs );
}
int
PBLOCK_ASSERT_INTOP( pb, LDAP_REQ_DELETE );
slapi_int_func_internal_pb( pb, op_delete );
- slap_graduate_commit_csn( pb->pop );
return 0;
}
{
SlapReply *rs;
Slapi_Entry *entry_orig = NULL;
+ OpExtraDB oex;
+ int rc;
if ( pb == NULL ) {
return -1;
PBLOCK_ASSERT_INTOP( pb, LDAP_REQ_ADD );
- rs = &pb->rs;
+ rs = pb->pb_rs;
- entry_orig = pb->pop->ora_e;
- pb->pop->ora_e = NULL;
+ entry_orig = pb->pb_op->ora_e;
+ pb->pb_op->ora_e = NULL;
+ /*
+ * The caller can specify a new entry, or a target DN and set
+ * of modifications, but not both.
+ */
if ( entry_orig != NULL ) {
- if ( pb->pop->ora_modlist != NULL || !BER_BVISNULL( &pb->pop->o_req_ndn )) {
+ if ( pb->pb_op->ora_modlist != NULL || !BER_BVISNULL( &pb->pb_op->o_req_ndn )) {
rs->sr_err = LDAP_PARAM_ERROR;
goto cleanup;
}
- assert( BER_BVISNULL( &pb->pop->o_req_dn ) ); /* shouldn't get set */
- ber_dupbv( &pb->pop->o_req_dn, &entry_orig->e_name );
- ber_dupbv( &pb->pop->o_req_ndn, &entry_orig->e_nname );
- } else if ( pb->pop->ora_modlist == NULL || BER_BVISNULL( &pb->pop->o_req_ndn )) {
+ assert( BER_BVISNULL( &pb->pb_op->o_req_dn ) ); /* shouldn't get set */
+ ber_dupbv( &pb->pb_op->o_req_dn, &entry_orig->e_name );
+ ber_dupbv( &pb->pb_op->o_req_ndn, &entry_orig->e_nname );
+ } else if ( pb->pb_op->ora_modlist == NULL || BER_BVISNULL( &pb->pb_op->o_req_ndn )) {
rs->sr_err = LDAP_PARAM_ERROR;
goto cleanup;
}
- /*
- * The caller can specify a new entry, or a target DN and set
- * of modifications, but not both.
- */
- pb->pop->ora_e = (Entry *)slapi_ch_calloc( 1, sizeof(Entry) );
- ber_dupbv( &pb->pop->ora_e->e_name, &pb->pop->o_req_dn );
- ber_dupbv( &pb->pop->ora_e->e_nname, &pb->pop->o_req_ndn );
+ pb->pb_op->ora_e = (Entry *)slapi_ch_calloc( 1, sizeof(Entry) );
+ ber_dupbv( &pb->pb_op->ora_e->e_name, &pb->pb_op->o_req_dn );
+ ber_dupbv( &pb->pb_op->ora_e->e_nname, &pb->pb_op->o_req_ndn );
if ( entry_orig != NULL ) {
- assert( pb->pop->ora_modlist == NULL );
+ assert( pb->pb_op->ora_modlist == NULL );
- rs->sr_err = slap_entry2mods( entry_orig, &pb->pop->ora_modlist,
- &rs->sr_text, pb->textbuf, sizeof( pb->textbuf ) );
+ rs->sr_err = slap_entry2mods( entry_orig, &pb->pb_op->ora_modlist,
+ &rs->sr_text, pb->pb_textbuf, sizeof( pb->pb_textbuf ) );
if ( rs->sr_err != LDAP_SUCCESS ) {
goto cleanup;
}
} else {
- assert( pb->pop->ora_modlist != NULL );
+ assert( pb->pb_op->ora_modlist != NULL );
}
- rs->sr_err = slap_mods_check( pb->pop->ora_modlist, &rs->sr_text,
- pb->textbuf, sizeof( pb->textbuf ), NULL );
+ rs->sr_err = slap_mods_check( pb->pb_op, pb->pb_op->ora_modlist, &rs->sr_text,
+ pb->pb_textbuf, sizeof( pb->pb_textbuf ), NULL );
if ( rs->sr_err != LDAP_SUCCESS ) {
goto cleanup;
}
- if ( slapi_int_func_internal_pb( pb, op_add ) == 0 ) {
- if ( pb->pop->ora_e != NULL && pb->pop->o_private != NULL ) {
- BackendDB *bd = pb->pop->o_bd;
-
- /* could we use SLAPI_BACKEND instead? */
- pb->pop->o_bd = (BackendDB *)pb->pop->o_private;
- pb->pop->o_private = NULL;
- be_entry_release_w( pb->pop, pb->pop->ora_e );
- pb->pop->ora_e = NULL;
- pb->pop->o_bd = bd;
- pb->pop->o_private = NULL;
+ /* Duplicate the values, because we may call slapi_entry_free() */
+ rs->sr_err = slap_mods2entry( pb->pb_op->ora_modlist, &pb->pb_op->ora_e,
+ 1, 0, &rs->sr_text, pb->pb_textbuf, sizeof( pb->pb_textbuf ) );
+ if ( rs->sr_err != LDAP_SUCCESS ) {
+ goto cleanup;
+ }
+
+ oex.oe.oe_key = (void *)do_add;
+ oex.oe_db = NULL;
+ LDAP_SLIST_INSERT_HEAD(&pb->pb_op->o_extra, &oex.oe, oe_next);
+ rc = slapi_int_func_internal_pb( pb, op_add );
+ LDAP_SLIST_REMOVE(&pb->pb_op->o_extra, &oex.oe, OpExtra, oe_next);
+
+ if ( !rc ) {
+ if ( pb->pb_op->ora_e != NULL && oex.oe_db != NULL ) {
+ BackendDB *bd = pb->pb_op->o_bd;
+
+ pb->pb_op->o_bd = oex.oe_db;
+ be_entry_release_w( pb->pb_op, pb->pb_op->ora_e );
+ pb->pb_op->ora_e = NULL;
+ pb->pb_op->o_bd = bd;
}
}
cleanup:
- slap_graduate_commit_csn( pb->pop );
- if ( pb->pop->ora_e != NULL ) {
- slapi_entry_free( pb->pop->ora_e );
- pb->pop->ora_e = NULL;
+ if ( pb->pb_op->ora_e != NULL ) {
+ slapi_entry_free( pb->pb_op->ora_e );
+ pb->pb_op->ora_e = NULL;
}
if ( entry_orig != NULL ) {
- pb->pop->ora_e = entry_orig;
- slapi_int_mods_free( pb->pop->ora_modlist );
- pb->pop->ora_modlist = NULL;
+ pb->pb_op->ora_e = entry_orig;
+ slap_mods_free( pb->pb_op->ora_modlist, 1 );
+ pb->pb_op->ora_modlist = NULL;
}
return 0;
PBLOCK_ASSERT_INTOP( pb, LDAP_REQ_MODRDN );
- if ( BER_BVISEMPTY( &pb->pop->o_req_ndn ) ) {
- pb->rs.sr_err = LDAP_UNWILLING_TO_PERFORM;
+ if ( BER_BVISEMPTY( &pb->pb_op->o_req_ndn ) ) {
+ pb->pb_rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
goto cleanup;
}
slapi_int_func_internal_pb( pb, op_modrdn );
cleanup:
- slap_graduate_commit_csn( pb->pop );
return 0;
}
PBLOCK_ASSERT_INTOP( pb, LDAP_REQ_MODIFY );
- rs = &pb->rs;
+ rs = pb->pb_rs;
- if ( pb->pop->orm_modlist == NULL ) {
+ if ( pb->pb_op->orm_modlist == NULL ) {
rs->sr_err = LDAP_PARAM_ERROR;
goto cleanup;
}
- if ( BER_BVISEMPTY( &pb->pop->o_req_ndn ) ) {
+ if ( BER_BVISEMPTY( &pb->pb_op->o_req_ndn ) ) {
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
goto cleanup;
}
- rs->sr_err = slap_mods_check( pb->pop->orm_modlist,
- &rs->sr_text, pb->textbuf, sizeof( pb->textbuf ), NULL );
+ rs->sr_err = slap_mods_check( pb->pb_op, pb->pb_op->orm_modlist,
+ &rs->sr_text, pb->pb_textbuf, sizeof( pb->pb_textbuf ), NULL );
if ( rs->sr_err != LDAP_SUCCESS ) {
goto cleanup;
}
slapi_int_func_internal_pb( pb, op_modify );
cleanup:
- slap_graduate_commit_csn( pb->pop );
return 0;
}
tp[i] = NULL;
slapi_pblock_set( pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, (void *)tp );
- slapi_pblock_set( pb, SLAPI_NENTRIES, (void *)i );
+ slapi_pblock_set( pb, SLAPI_NENTRIES, (void *)&i );
return LDAP_SUCCESS;
}
PBLOCK_ASSERT_INTOP( pb, LDAP_REQ_SEARCH );
- rs = &pb->rs;
+ rs = pb->pb_rs;
/* search callback and arguments */
slapi_pblock_set( pb, SLAPI_X_INTOP_RESULT_CALLBACK, (void *)prc );
slapi_pblock_set( pb, SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK, (void *)prec );
slapi_pblock_set( pb, SLAPI_X_INTOP_CALLBACK_DATA, (void *)callback_data );
- if ( BER_BVISEMPTY( &pb->pop->ors_filterstr )) {
+ if ( BER_BVISEMPTY( &pb->pb_op->ors_filterstr )) {
rs->sr_err = LDAP_PARAM_ERROR;
goto cleanup;
}
- if ( pb->pop->ors_filter == NULL ) {
- pb->pop->ors_filter = slapi_str2filter( pb->pop->ors_filterstr.bv_val );
- if ( pb->pop->ors_filter == NULL ) {
+ if ( pb->pb_op->ors_filter == NULL ) {
+ pb->pb_op->ors_filter = slapi_str2filter( pb->pb_op->ors_filterstr.bv_val );
+ if ( pb->pb_op->ors_filter == NULL ) {
rs->sr_err = LDAP_PROTOCOL_ERROR;
goto cleanup;
}
cleanup:
if ( free_filter ) {
- slapi_filter_free( pb->pop->ors_filter, 1 );
- pb->pop->ors_filter = NULL;
+ slapi_filter_free( pb->pb_op->ors_filter, 1 );
+ pb->pb_op->ors_filter = NULL;
}
- slapi_pblock_set( pb, SLAPI_X_INTOP_RESULT_CALLBACK, NULL );
- slapi_pblock_set( pb, SLAPI_X_INTOP_SEARCH_ENTRY_CALLBACK, NULL );
- slapi_pblock_set( pb, SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK, NULL );
- slapi_pblock_set( pb, SLAPI_X_INTOP_CALLBACK_DATA, NULL );
+ slapi_pblock_delete_param( pb, SLAPI_X_INTOP_RESULT_CALLBACK );
+ slapi_pblock_delete_param( pb, SLAPI_X_INTOP_SEARCH_ENTRY_CALLBACK );
+ slapi_pblock_delete_param( pb, SLAPI_X_INTOP_REFERRAL_ENTRY_CALLBACK );
+ slapi_pblock_delete_param( pb, SLAPI_X_INTOP_CALLBACK_DATA );
return 0;
}
Slapi_ComponentId *plugin_identity,
int operation_flags )
{
+ int no_limit = SLAP_NO_LIMIT;
+ int deref = LDAP_DEREF_NEVER;
+
slapi_int_connection_init_pb( pb, LDAP_REQ_SEARCH );
slapi_pblock_set( pb, SLAPI_SEARCH_TARGET, (void *)base );
- slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, (void *)scope );
- slapi_pblock_set( pb, SLAPI_SEARCH_FILTER, NULL );
+ slapi_pblock_set( pb, SLAPI_SEARCH_SCOPE, (void *)&scope );
+ slapi_pblock_set( pb, SLAPI_SEARCH_FILTER, (void *)0 );
slapi_pblock_set( pb, SLAPI_SEARCH_STRFILTER, (void *)filter );
slapi_pblock_set( pb, SLAPI_SEARCH_ATTRS, (void *)attrs );
- slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, (void *)attrsonly );
+ slapi_pblock_set( pb, SLAPI_SEARCH_ATTRSONLY, (void *)&attrsonly );
slapi_pblock_set( pb, SLAPI_REQCONTROLS, (void *)controls );
slapi_pblock_set( pb, SLAPI_TARGET_UNIQUEID, (void *)uniqueid );
slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
- slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)operation_flags );
- slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, (void *)0 );
- slapi_pblock_set( pb, SLAPI_SEARCH_SIZELIMIT, (void *)SLAP_NO_LIMIT );
- slapi_pblock_set( pb, SLAPI_SEARCH_TIMELIMIT, (void *)SLAP_NO_LIMIT );
+ slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)&operation_flags );
+ slapi_pblock_set( pb, SLAPI_SEARCH_DEREF, (void *)&deref );
+ slapi_pblock_set( pb, SLAPI_SEARCH_SIZELIMIT, (void *)&no_limit );
+ slapi_pblock_set( pb, SLAPI_SEARCH_TIMELIMIT, (void *)&no_limit );
slapi_int_set_operation_dn( pb );
}
slapi_pblock_set( pb, SLAPI_REQCONTROLS, (void *)controls );
slapi_pblock_set( pb, SLAPI_TARGET_UNIQUEID, (void *)uniqueid );
slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
- slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)operation_flags );
+ slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)&operation_flags );
slapi_int_set_operation_dn( pb );
}
pb = slapi_pblock_new();
- slapi_modify_internal_set_pb( pb, ldn, mods, controls, NULL, NULL,
- log_change ? SLAPI_OP_FLAG_LOG_CHANGE : 0 );
-
+ slapi_modify_internal_set_pb( pb, ldn, mods, controls, NULL, NULL, 0 );
+ slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
slapi_modify_internal_pb( pb );
return pb;
slapi_pblock_set( pb, SLAPI_MODIFY_MODS, (void *)attrs );
slapi_pblock_set( pb, SLAPI_REQCONTROLS, (void *)controls );
slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
- slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)operation_flags );
+ slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)&operation_flags );
slapi_int_set_operation_dn( pb );
return 0;
char * dn,
LDAPMod **attrs,
LDAPControl **controls,
- int log_changes )
+ int log_change )
{
Slapi_PBlock *pb;
pb = slapi_pblock_new();
- slapi_add_internal_set_pb( pb, dn, attrs, controls, NULL,
- log_changes ? SLAPI_OP_FLAG_LOG_CHANGE : 0 );
-
+ slapi_add_internal_set_pb( pb, dn, attrs, controls, NULL, 0);
+ slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
slapi_add_internal_pb( pb );
return pb;
slapi_pblock_set( pb, SLAPI_ADD_ENTRY, (void *)e );
slapi_pblock_set( pb, SLAPI_REQCONTROLS, (void *)controls );
slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
- slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)operation_flags );
+ slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)&operation_flags );
slapi_int_set_operation_dn( pb );
}
slapi_add_entry_internal(
Slapi_Entry *e,
LDAPControl **controls,
- int log_changes )
+ int log_change )
{
Slapi_PBlock *pb;
pb = slapi_pblock_new();
- slapi_add_entry_internal_set_pb( pb, e, controls, NULL,
- log_changes ? SLAPI_OP_FLAG_LOG_CHANGE : 0 );
-
+ slapi_add_entry_internal_set_pb( pb, e, controls, NULL, 0 );
+ slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
slapi_add_internal_pb( pb );
return pb;
slapi_pblock_set( pb, SLAPI_MODRDN_TARGET, (void *)olddn );
slapi_pblock_set( pb, SLAPI_MODRDN_NEWRDN, (void *)newrdn );
slapi_pblock_set( pb, SLAPI_MODRDN_NEWSUPERIOR, (void *)newsuperior );
- slapi_pblock_set( pb, SLAPI_MODRDN_DELOLDRDN, (void *)deloldrdn );
+ slapi_pblock_set( pb, SLAPI_MODRDN_DELOLDRDN, (void *)&deloldrdn );
slapi_pblock_set( pb, SLAPI_REQCONTROLS, (void *)controls );
slapi_pblock_set( pb, SLAPI_TARGET_UNIQUEID, (void *)uniqueid );
slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
- slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)operation_flags );
+ slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)&operation_flags );
+ slap_modrdn2mods( pb->pb_op, pb->pb_rs );
slapi_int_set_operation_dn( pb );
}
pb = slapi_pblock_new ();
slapi_rename_internal_set_pb( pb, olddn, lnewrdn, NULL,
- deloldrdn, controls, NULL, NULL,
- log_change ? SLAPI_OP_FLAG_LOG_CHANGE : 0 );
-
+ deloldrdn, controls, NULL, NULL, 0 );
+ slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
slapi_modrdn_internal_pb( pb );
return pb;
slapi_pblock_set( pb, SLAPI_REQCONTROLS, (void *)controls );
slapi_pblock_set( pb, SLAPI_TARGET_UNIQUEID, (void *)uniqueid );
slapi_pblock_set( pb, SLAPI_PLUGIN_IDENTITY, (void *)plugin_identity );
- slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)operation_flags );
+ slapi_pblock_set( pb, SLAPI_X_INTOP_FLAGS, (void *)&operation_flags );
slapi_int_set_operation_dn( pb );
}
pb = slapi_pblock_new();
- slapi_delete_internal_set_pb( pb, ldn, controls, NULL, NULL,
- log_change ? SLAPI_OP_FLAG_LOG_CHANGE : 0 );
-
+ slapi_delete_internal_set_pb( pb, ldn, controls, NULL, NULL, 0 );
+ slapi_pblock_set( pb, SLAPI_LOG_OPERATION, (void *)&log_change );
slapi_delete_internal_pb( pb );
return pb;