mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
ITS#6758 Reset some SlapReply flags & data.
Reset data more consistenlty. When resetting sr_entry after sending data, reset sr_flag as well. Reset rs_attrs and Extended Operation oid/data after setting and sending them.
This commit is contained in:
parent
f7a77545ad
commit
d2b024be4a
@ -959,6 +959,7 @@ fetch_entry_retry:
|
||||
rs->sr_flags = REP_ENTRY_MUSTRELEASE;
|
||||
rs->sr_err = LDAP_SUCCESS;
|
||||
rs->sr_err = send_search_entry( op, rs );
|
||||
rs->sr_attrs = NULL;
|
||||
|
||||
/* send_search_entry will usually free it.
|
||||
* an overlay might leave its own copy here;
|
||||
|
@ -219,6 +219,7 @@ dnssrv_back_search(
|
||||
send_search_entry( op, rs );
|
||||
rs->sr_entry = NULL;
|
||||
rs->sr_attrs = NULL;
|
||||
rs->sr_flags = 0;
|
||||
}
|
||||
|
||||
entry_clean( &e );
|
||||
@ -237,4 +238,3 @@ done:
|
||||
if( urls != NULL ) ber_bvarray_free( urls );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -371,6 +371,7 @@ retry:
|
||||
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 );
|
||||
@ -428,6 +429,7 @@ retry:
|
||||
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 );
|
||||
|
||||
@ -1011,4 +1013,3 @@ cleanup:
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -660,9 +660,14 @@ ldif_send_entry( Operation *op, SlapReply *rs, Entry *e, int scope )
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -483,6 +483,7 @@ static int ndb_oc_search( Operation *op, SlapReply *rs, Ndb *ndb, NdbTransaction
|
||||
rs->sr_flags = 0;
|
||||
rc = send_search_entry( op, rs );
|
||||
rs->sr_entry = NULL;
|
||||
rs->sr_attrs = NULL;
|
||||
} else {
|
||||
rc = 0;
|
||||
}
|
||||
|
@ -123,6 +123,8 @@ passwd_back_search(
|
||||
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 );
|
||||
@ -173,6 +175,8 @@ passwd_back_search(
|
||||
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 );
|
||||
@ -238,6 +242,9 @@ passwd_back_search(
|
||||
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 );
|
||||
|
@ -92,8 +92,10 @@ perl_back_search(
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -124,4 +126,3 @@ done:;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,7 @@ read_and_send_results(
|
||||
rs->sr_flags = REP_ENTRY_MODIFIABLE;
|
||||
send_search_entry( op, rs );
|
||||
entry_free( rs->sr_entry );
|
||||
rs->sr_attrs = NULL;
|
||||
}
|
||||
|
||||
bp = buf;
|
||||
|
@ -100,6 +100,7 @@ sock_read_and_send_results(
|
||||
rs->sr_flags = REP_ENTRY_MODIFIABLE;
|
||||
send_search_entry( op, rs );
|
||||
entry_free( rs->sr_entry );
|
||||
rs->sr_attrs = NULL;
|
||||
}
|
||||
|
||||
bp = buf;
|
||||
|
@ -244,10 +244,12 @@ fe_extended( Operation *op, SlapReply *rs )
|
||||
|
||||
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 */
|
||||
|
||||
|
@ -165,7 +165,9 @@ retcode_send_onelevel( Operation *op, SlapReply *rs )
|
||||
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 */
|
||||
|
@ -1169,6 +1169,7 @@ static int translucent_search(Operation *op, SlapReply *rs) {
|
||||
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 );
|
||||
|
Loading…
Reference in New Issue
Block a user