* returned or filtered out
* e_flags: array of a_flags
*/
- char **e_flags = NULL;
+ char **e_flags = NULL;
+ Entry *e;
rs->sr_type = REP_SEARCH;
if (op->o_callback) {
if ( rc != SLAP_CB_CONTINUE ) goto error_return;
}
+ e = rs->sr_mentry ? rs->sr_mentry : rs->sr_entry;
+
#ifdef NEW_LOGGING
- LDAP_LOG( OPERATION, ENTRY, "send_search_entry: conn %lu dn=\"%s\"%s\n",
- op->o_connid, rs->sr_entry->e_name.bv_val,
+ LDAP_LOG( OPERATION, ENTRY, "send_search_entry: conn %lu dn=\"%s\"%s\n",
+ op->o_connid, e->e_name.bv_val,
op->ors_attrsonly ? " (attrsOnly)" : "" );
#else
- Debug( LDAP_DEBUG_TRACE, "=> send_search_entry: dn=\"%s\"%s\n",
- rs->sr_entry->e_name.bv_val,
- op->ors_attrsonly ? " (attrsOnly)" : "", 0 );
+ Debug( LDAP_DEBUG_TRACE, "=> send_search_entry: conn %lu dn=\"%s\"%s\n",
+ op->o_connid, e->e_name.bv_val,
+ op->ors_attrsonly ? " (attrsOnly)" : "" );
#endif
- if ( !access_allowed( op, rs->sr_entry, ad_entry, NULL, ACL_READ, NULL )) {
+ if ( !access_allowed( op, e, ad_entry, NULL, ACL_READ, NULL )) {
#ifdef NEW_LOGGING
LDAP_LOG( ACL, INFO,
"send_search_entry: conn %lu access to entry (%s) not allowed\n",
- op->o_connid, rs->sr_entry->e_name.bv_val, 0 );
+ op->o_connid, e->e_name.bv_val, 0 );
#else
Debug( LDAP_DEBUG_ACL,
"send_search_entry: access to entry not allowed\n",
goto error_return;
}
- edn = rs->sr_entry->e_nname.bv_val;
+ edn = e->e_nname.bv_val;
if ( op->o_res_ber ) {
/* read back control or LDAP_CONNECTIONLESS */
- ber = op->o_res_ber;
+ ber = op->o_res_ber;
+
} else {
ber_len_t siz, len;
struct berval bv;
- entry_flatsize( rs->sr_entry, &siz, &len, 0 );
+ entry_flatsize( e, &siz, &len, 0 );
bv.bv_len = siz + len;
bv.bv_val = op->o_tmpalloc(bv.bv_len, op->o_tmpmemctx );
if ( op->o_conn && op->o_conn->c_is_udp ) {
/* CONNECTIONLESS */
if ( op->o_protocol == LDAP_VERSION2 ) {
- rc = ber_printf(ber, "t{O{" /*}}*/,
- LDAP_RES_SEARCH_ENTRY, &rs->sr_entry->e_name );
+ rc = ber_printf(ber, "t{O{" /*}}*/,
+ LDAP_RES_SEARCH_ENTRY, &e->e_name );
} else {
- rc = ber_printf( ber, "{it{O{" /*}}}*/, op->o_msgid,
- LDAP_RES_SEARCH_ENTRY, &rs->sr_entry->e_name );
+ rc = ber_printf( ber, "{it{O{" /*}}}*/, op->o_msgid,
+ LDAP_RES_SEARCH_ENTRY, &e->e_name );
}
} else
#endif
if ( op->o_res_ber ) {
/* read back control */
- rc = ber_printf( ber, "{O{" /*}}*/, &rs->sr_entry->e_name );
+ rc = ber_printf( ber, "{O{" /*}}*/, &e->e_name );
} else {
- rc = ber_printf( ber, "{it{O{" /*}}}*/, op->o_msgid,
- LDAP_RES_SEARCH_ENTRY, &rs->sr_entry->e_name );
+ rc = ber_printf( ber, "{it{O{" /*}}}*/, op->o_msgid,
+ LDAP_RES_SEARCH_ENTRY, &e->e_name );
}
if ( rc == -1 ) {
int k = 0;
size_t size;
- for ( a = rs->sr_entry->e_attrs, i=0; a != NULL; a = a->a_next, i++ ) {
+ for ( a = e->e_attrs, i=0; a != NULL; a = a->a_next, i++ ) {
for ( j = 0; a->a_vals[j].bv_val != NULL; j++ ) k++;
}
}
a_flags = (char *)(e_flags + i);
memset( a_flags, 0, k );
- for ( a=rs->sr_entry->e_attrs, i=0; a != NULL; a=a->a_next, i++ ) {
+ for ( a = e->e_attrs, i = 0; a != NULL; a = a->a_next, i++ ) {
for ( j = 0; a->a_vals[j].bv_val != NULL; j++ );
e_flags[i] = a_flags;
a_flags += j;
}
- rc = filter_matched_values(op, rs->sr_entry->e_attrs, &e_flags) ;
+ rc = filter_matched_values(op, e->e_attrs, &e_flags) ;
if ( rc == -1 ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ERR, "send_search_entry: "
}
}
- for ( a = rs->sr_entry->e_attrs, j = 0; a != NULL; a = a->a_next, j++ ) {
+ for ( a = e->e_attrs, j = 0; a != NULL; a = a->a_next, j++ ) {
AttributeDescription *desc = a->a_desc;
int finish = 0;
}
if ( op->ors_attrsonly ) {
- if ( ! access_allowed( op, rs->sr_entry, desc, NULL,
+ if ( ! access_allowed( op, e, desc, NULL,
ACL_READ, &acl_state ) )
{
#ifdef NEW_LOGGING
} else {
int first = 1;
for ( i = 0; a->a_nvals[i].bv_val != NULL; i++ ) {
- if ( ! access_allowed( op, rs->sr_entry,
+ if ( ! access_allowed( op, e,
desc, &a->a_nvals[i], ACL_READ, &acl_state ) )
{
#ifdef NEW_LOGGING
}
}
- if ( ! access_allowed( op, rs->sr_entry, desc, NULL,
+ if ( ! access_allowed( op, e, desc, NULL,
ACL_READ, &acl_state ) )
{
#ifdef NEW_LOGGING
if ( ! op->ors_attrsonly ) {
for ( i = 0; a->a_vals[i].bv_val != NULL; i++ ) {
- if ( ! access_allowed( op, rs->sr_entry,
+ if ( ! access_allowed( op, e,
desc, &a->a_vals[i], ACL_READ, &acl_state ) )
{
#ifdef NEW_LOGGING
if ( rs->sr_attrs != NULL ) {
for ( anp = rs->sr_attrs; anp->an_name.bv_val != NULL; anp++ ) {
rc = compute_evaluator( &ctx, anp->an_name.bv_val,
- rs->sr_entry, slapi_int_compute_output_ber );
+ e, slapi_int_compute_output_ber );
if ( rc == 1 ) break;
}
} else {
* plugin decide whether to be naughty or not.
*/
rc = compute_evaluator( &ctx, "*",
- rs->sr_entry, slapi_int_compute_output_ber );
+ e, slapi_int_compute_output_ber );
}
if ( rc == 1 ) {
if ( op->o_res_ber == NULL ) ber_free_buf( ber );
}
Statslog( LDAP_DEBUG_STATS2, "conn=%lu op=%lu ENTRY dn=\"%s\"\n",
- op->o_connid, op->o_opid, rs->sr_entry->e_dn, 0, 0 );
+ op->o_connid, op->o_opid, e->e_dn, 0, 0 );
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, ENTRY,