Commit 63f9ff62 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#5374

parent b309f770
...@@ -38,6 +38,7 @@ OpenLDAP 2.4.8 Engineering ...@@ -38,6 +38,7 @@ OpenLDAP 2.4.8 Engineering
Fixed slapd-monitor crash (ITS#5311) Fixed slapd-monitor crash (ITS#5311)
Fixed slapd-relay compare (ITS#4937) Fixed slapd-relay compare (ITS#4937)
Added slapd-sock (ITS#4094) Added slapd-sock (ITS#4094)
Fixed slapo-accesslog cleanup on successful response (ITS#5374)
Added slapo-autogroup contrib module (ITS#5145) Added slapo-autogroup contrib module (ITS#5145)
Added slapo-constraint cross-attribute constraints (ITS#4987) Added slapo-constraint cross-attribute constraints (ITS#4987)
Fixed slapo-memberof objectClass inheritance (ITS#5299) Fixed slapo-memberof objectClass inheritance (ITS#5299)
......
...@@ -67,7 +67,6 @@ typedef struct log_info { ...@@ -67,7 +67,6 @@ typedef struct log_info {
Entry *li_old; Entry *li_old;
log_attr *li_oldattrs; log_attr *li_oldattrs;
int li_success; int li_success;
int li_unlock;
ldap_pvt_thread_rmutex_t li_op_rmutex; ldap_pvt_thread_rmutex_t li_op_rmutex;
ldap_pvt_thread_mutex_t li_log_mutex; ldap_pvt_thread_mutex_t li_log_mutex;
} log_info; } log_info;
...@@ -1339,10 +1338,17 @@ static int accesslog_response(Operation *op, SlapReply *rs) { ...@@ -1339,10 +1338,17 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
return SLAP_CB_CONTINUE; return SLAP_CB_CONTINUE;
if ( lo->mask & LOG_OP_WRITES ) { if ( lo->mask & LOG_OP_WRITES ) {
slap_callback *cb;
ldap_pvt_thread_mutex_lock( &li->li_log_mutex ); ldap_pvt_thread_mutex_lock( &li->li_log_mutex );
old = li->li_old; old = li->li_old;
li->li_old = NULL; li->li_old = NULL;
li->li_unlock = 0; /* Disarm mod_cleanup */
for ( cb = op->o_callback->sc_next; cb; cb = cb->sc_next ) {
if ( cb->sc_private == (void *)on ) {
cb->sc_private = NULL;
break;
}
}
ldap_pvt_thread_rmutex_unlock( &li->li_op_rmutex, op->o_tid ); ldap_pvt_thread_rmutex_unlock( &li->li_op_rmutex, op->o_tid );
} }
...@@ -1693,12 +1699,11 @@ accesslog_mod_cleanup( Operation *op, SlapReply *rs ) ...@@ -1693,12 +1699,11 @@ accesslog_mod_cleanup( Operation *op, SlapReply *rs )
{ {
slap_callback *sc = op->o_callback; slap_callback *sc = op->o_callback;
slap_overinst *on = sc->sc_private; slap_overinst *on = sc->sc_private;
log_info *li = on->on_bi.bi_private;
op->o_callback = sc->sc_next; op->o_callback = sc->sc_next;
op->o_tmpfree( sc, op->o_tmpmemctx ); op->o_tmpfree( sc, op->o_tmpmemctx );
if ( li->li_unlock ) { if ( on ) {
BackendInfo *bi = op->o_bd->bd_info; BackendInfo *bi = op->o_bd->bd_info;
op->o_bd->bd_info = (BackendInfo *)on; op->o_bd->bd_info = (BackendInfo *)on;
accesslog_response( op, rs ); accesslog_response( op, rs );
...@@ -1714,15 +1719,15 @@ accesslog_op_mod( Operation *op, SlapReply *rs ) ...@@ -1714,15 +1719,15 @@ accesslog_op_mod( Operation *op, SlapReply *rs )
log_info *li = on->on_bi.bi_private; log_info *li = on->on_bi.bi_private;
if ( li->li_ops & LOG_OP_WRITES ) { if ( li->li_ops & LOG_OP_WRITES ) {
slap_callback *cb = op->o_tmpalloc( sizeof( slap_callback ), op->o_tmpmemctx ); slap_callback *cb = op->o_tmpalloc( sizeof( slap_callback ), op->o_tmpmemctx ), *cb2;
cb->sc_cleanup = accesslog_mod_cleanup; cb->sc_cleanup = accesslog_mod_cleanup;
cb->sc_response = NULL; cb->sc_response = NULL;
cb->sc_private = on; cb->sc_private = on;
cb->sc_next = op->o_callback; cb->sc_next = NULL;
op->o_callback = cb; for ( cb2 = op->o_callback; cb2->sc_next; cb2 = cb2->sc_next );
cb2->sc_next = cb;
ldap_pvt_thread_rmutex_lock( &li->li_op_rmutex, op->o_tid ); ldap_pvt_thread_rmutex_lock( &li->li_op_rmutex, op->o_tid );
li->li_unlock = 1;
if ( li->li_oldf && ( op->o_tag == LDAP_REQ_DELETE || if ( li->li_oldf && ( op->o_tag == LDAP_REQ_DELETE ||
op->o_tag == LDAP_REQ_MODIFY || op->o_tag == LDAP_REQ_MODIFY ||
( op->o_tag == LDAP_REQ_MODRDN && li->li_oldattrs ))) { ( op->o_tag == LDAP_REQ_MODRDN && li->li_oldattrs ))) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment