ITS#5259 fix sasl_auxprop_store to allow cleanup after bindop is gone

This commit is contained in:
Howard Chu 2007-12-22 22:53:58 +00:00
parent d88ab7bf36
commit d0eac819f7
3 changed files with 35 additions and 12 deletions

View File

@ -1895,6 +1895,27 @@ connection_fake_init(
connection_fake_init2( conn, opbuf, ctx, 1 );
}
void
operation_fake_init(
Connection *conn,
Operation *op,
void *ctx,
int newmem )
{
/* set memory context */
op->o_tmpmemctx = slap_sl_mem_create(SLAP_SLAB_SIZE, SLAP_SLAB_STACK, ctx,
newmem );
op->o_tmpmfuncs = &slap_sl_mfuncs;
op->o_threadctx = ctx;
op->o_tid = ldap_pvt_thread_pool_tid( ctx );
op->o_counters = &slap_counters;
op->o_conn = conn;
op->o_connid = op->o_conn->c_connid;
connection_init_log_prefix( op );
}
void
connection_fake_init2(
Connection *conn,
@ -1917,17 +1938,7 @@ connection_fake_init2(
op->o_hdr = &opbuf->ob_hdr;
op->o_controls = opbuf->ob_controls;
/* set memory context */
op->o_tmpmemctx = slap_sl_mem_create(SLAP_SLAB_SIZE, SLAP_SLAB_STACK, ctx,
newmem );
op->o_tmpmfuncs = &slap_sl_mfuncs;
op->o_threadctx = ctx;
op->o_tid = ldap_pvt_thread_pool_tid( ctx );
op->o_counters = &slap_counters;
op->o_conn = conn;
op->o_connid = op->o_conn->c_connid;
connection_init_log_prefix( op );
operation_fake_init( conn, op, ctx, newmem );
#ifdef LDAP_SLAPI
if ( slapi_plugins_used ) {

View File

@ -756,6 +756,11 @@ LDAP_SLAPD_F (void) connection_fake_init2 LDAP_P((
OperationBuffer *opbuf,
void *threadctx,
int newmem ));
LDAP_SLAPD_F (void) operation_fake_init LDAP_P((
Connection *conn,
Operation *op,
void *threadctx,
int newmem ));
LDAP_SLAPD_F (void) connection_assign_nextid LDAP_P((Connection *));
/*

View File

@ -406,6 +406,7 @@ slap_auxprop_store(
unsigned ulen)
{
Operation op = {0};
Opheader oph;
SlapReply rs = {REP_RESULT};
int rc, i, j;
Connection *conn = NULL;
@ -476,7 +477,13 @@ slap_auxprop_store(
&text, textbuf, textlen );
if ( rc == LDAP_SUCCESS ) {
op.o_hdr = conn->c_sasl_bindop->o_hdr;
if ( conn->c_sasl_bindop ) {
op.o_hdr = conn->c_sasl_bindop->o_hdr;
} else {
op.o_hdr = &oph;
memset( &oph, 0, sizeof(oph) );
operation_fake_init( conn, &op, ldap_pvt_thread_pool_context(), 0 );
}
op.o_tag = LDAP_REQ_MODIFY;
op.o_ndn = op.o_req_ndn;
op.o_callback = &cb;