mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-26 17:49:59 -05:00
changes required to use rwm overlay
This commit is contained in:
parent
f02b6cfba7
commit
723bc044e0
3 changed files with 36 additions and 10 deletions
|
|
@ -205,6 +205,7 @@ rwm_search( Operation *op, SlapReply *rs )
|
|||
return rc;
|
||||
}
|
||||
|
||||
/* TODO: rewrite/map filter & attrs */
|
||||
return SLAP_CB_CONTINUE;
|
||||
}
|
||||
|
||||
|
|
@ -223,6 +224,7 @@ rwm_extended( Operation *op, SlapReply *rs )
|
|||
return rc;
|
||||
}
|
||||
|
||||
/* TODO: rewrite/map extended data ? ... */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -324,6 +326,9 @@ rwm_send_entry( Operation *op, SlapReply *rs )
|
|||
e->e_nname = ndn;
|
||||
|
||||
rs->sr_entry = e;
|
||||
|
||||
/* TODO: map entry attribute types, objectclasses
|
||||
* and dn-valued attribute values */
|
||||
|
||||
return SLAP_CB_CONTINUE;
|
||||
|
||||
|
|
|
|||
|
|
@ -254,7 +254,7 @@ send_ldap_response(
|
|||
|
||||
if (op->o_callback && op->o_callback->sc_response) {
|
||||
rc = op->o_callback->sc_response( op, rs );
|
||||
if ( rc != SLAP_CB_CONTINUE ) return;
|
||||
if ( rc != SLAP_CB_CONTINUE ) goto cleanup;
|
||||
}
|
||||
|
||||
#ifdef LDAP_CONNECTIONLESS
|
||||
|
|
@ -370,7 +370,7 @@ send_ldap_response(
|
|||
if (!op->o_conn || op->o_conn->c_is_udp == 0)
|
||||
#endif
|
||||
ber_free_buf( ber );
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
/* send BER */
|
||||
|
|
@ -391,7 +391,7 @@ send_ldap_response(
|
|||
0, 0, 0 );
|
||||
#endif
|
||||
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
#ifdef LDAP_SLAPI
|
||||
|
|
@ -406,6 +406,13 @@ send_ldap_response(
|
|||
num_bytes_sent += bytes;
|
||||
num_pdu_sent++;
|
||||
ldap_pvt_thread_mutex_unlock( &num_sent_mutex );
|
||||
|
||||
cleanup:;
|
||||
if ( rs->sr_matched && rs->sr_flags & REP_MATCHED_MUSTBEFREED ) {
|
||||
free( rs->sr_matched );
|
||||
rs->sr_matched = NULL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -656,7 +663,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
|
|||
rs->sr_type = REP_SEARCH;
|
||||
if (op->o_callback && op->o_callback->sc_response) {
|
||||
rc = op->o_callback->sc_response( op, rs );
|
||||
if ( rc != SLAP_CB_CONTINUE ) return rc;
|
||||
if ( rc != SLAP_CB_CONTINUE ) goto error_return;
|
||||
}
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
|
|
@ -682,8 +689,8 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
|
|||
0, 0, 0 );
|
||||
#endif
|
||||
|
||||
sl_release( mark, op->o_tmpmemctx );
|
||||
return( 1 );
|
||||
rc = 1;
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
edn = rs->sr_entry->e_nname.bv_val;
|
||||
|
|
@ -1171,8 +1178,8 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
|
|||
|
||||
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
|
||||
send_ldap_error( op, rs, LDAP_OTHER, "encode entry end error" );
|
||||
sl_release( mark, op->o_tmpmemctx );
|
||||
return( 1 );
|
||||
rc = 1;
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
if ( op->o_res_ber == NULL ) {
|
||||
|
|
@ -1190,8 +1197,8 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
|
|||
0, 0, 0 );
|
||||
#endif
|
||||
|
||||
sl_release( mark, op->o_tmpmemctx );
|
||||
return -1;
|
||||
rc = -1;
|
||||
goto error_return;
|
||||
}
|
||||
rs->sr_nentries++;
|
||||
|
||||
|
|
@ -1215,8 +1222,18 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
|
|||
rc = 0;
|
||||
|
||||
error_return:;
|
||||
if ( op->o_tag == LDAP_REQ_SEARCH && rs->sr_type == REP_SEARCH
|
||||
&& rs->sr_entry
|
||||
&& (rs->sr_flags & REP_ENTRY_MUSTBEFREED) )
|
||||
{
|
||||
entry_free( rs->sr_entry );
|
||||
rs->sr_entry = NULL;
|
||||
rs->sr_flags &= ~REP_ENTRY_MUSTBEFREED;
|
||||
}
|
||||
|
||||
sl_release( mark, op->o_tmpmemctx );
|
||||
if ( e_flags ) sl_free( e_flags, op->o_tmpmemctx );
|
||||
|
||||
return( rc );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1629,6 +1629,10 @@ typedef struct slap_rep {
|
|||
rep_extended_s sru_extended;
|
||||
rep_search_s sru_search;
|
||||
} sr_un;
|
||||
slap_mask_t sr_flags;
|
||||
#define REP_ENTRY_MODIFIABLE 0x00000001
|
||||
#define REP_ENTRY_MUSTBEFREED 0x00000002
|
||||
#define REP_MATCHED_MUSTBEFREED 0x00000010
|
||||
} SlapReply;
|
||||
|
||||
/* short hands for response members */
|
||||
|
|
|
|||
Loading…
Reference in a new issue