Commit 9a914e1c authored by Howard Chu's avatar Howard Chu
Browse files

glue/rwm fixes from HEAD

ITS#3971, #4458, #4638, #4689
parent 86fe40bf
......@@ -87,6 +87,15 @@ typedef struct glue_state {
int nctrls;
} glue_state;
static int
glue_op_cleanup( Operation *op, SlapReply *rs )
{
/* This is not a final result */
if (rs->sr_type == REP_RESULT )
rs->sr_type = REP_GLUE_RESULT;
return SLAP_CB_CONTINUE;
}
static int
glue_op_response ( Operation *op, SlapReply *rs )
{
......@@ -192,6 +201,7 @@ glue_op_func ( Operation *op, SlapReply *rs )
case LDAP_REQ_DELETE: which = op_delete; break;
case LDAP_REQ_MODIFY: which = op_modify; break;
case LDAP_REQ_MODRDN: which = op_modrdn; break;
case LDAP_REQ_EXTENDED: which = op_extended; break;
default: assert( 0 ); break;
}
......@@ -316,7 +326,7 @@ glue_op_search ( Operation *op, SlapReply *rs )
int i;
long stoptime = 0, starttime;
glue_state gs = {NULL, NULL, NULL, 0, 0, 0, 0};
slap_callback cb = { NULL, glue_op_response, NULL, NULL };
slap_callback cb = { NULL, glue_op_response, glue_op_cleanup, NULL };
int scope0, tlimit0;
struct berval dn, ndn, *pdn;
......@@ -1019,6 +1029,7 @@ glue_sub_init()
glue.on_bi.bi_op_modrdn = glue_op_func;
glue.on_bi.bi_op_add = glue_op_func;
glue.on_bi.bi_op_delete = glue_op_func;
glue.on_bi.bi_extended = glue_op_func;
glue.on_bi.bi_chk_referrals = glue_chk_referrals;
glue.on_bi.bi_chk_controls = glue_chk_controls;
......
This diff is collapsed.
......@@ -449,6 +449,7 @@ rwm_int_filter_map_rewrite(
{
int i;
Filter *p;
AttributeDescription *ad;
struct berval atmp,
vtmp,
*tmp;
......@@ -475,7 +476,8 @@ rwm_int_filter_map_rewrite(
switch ( f->f_choice ) {
case LDAP_FILTER_EQUALITY:
if ( map_attr_value( dc, &f->f_av_desc, &atmp,
ad = f->f_av_desc;
if ( map_attr_value( dc, &ad, &atmp,
&f->f_av_value, &vtmp, RWM_MAP ) )
{
goto computed;
......@@ -491,7 +493,8 @@ rwm_int_filter_map_rewrite(
break;
case LDAP_FILTER_GE:
if ( map_attr_value( dc, &f->f_av_desc, &atmp,
ad = f->f_av_desc;
if ( map_attr_value( dc, &ad, &atmp,
&f->f_av_value, &vtmp, RWM_MAP ) )
{
goto computed;
......@@ -507,7 +510,8 @@ rwm_int_filter_map_rewrite(
break;
case LDAP_FILTER_LE:
if ( map_attr_value( dc, &f->f_av_desc, &atmp,
ad = f->f_av_desc;
if ( map_attr_value( dc, &ad, &atmp,
&f->f_av_value, &vtmp, RWM_MAP ) )
{
goto computed;
......@@ -523,7 +527,8 @@ rwm_int_filter_map_rewrite(
break;
case LDAP_FILTER_APPROX:
if ( map_attr_value( dc, &f->f_av_desc, &atmp,
ad = f->f_av_desc;
if ( map_attr_value( dc, &ad, &atmp,
&f->f_av_value, &vtmp, RWM_MAP ) )
{
goto computed;
......@@ -539,7 +544,8 @@ rwm_int_filter_map_rewrite(
break;
case LDAP_FILTER_SUBSTRINGS:
if ( map_attr_value( dc, &f->f_sub_desc, &atmp,
ad = f->f_sub_desc;
if ( map_attr_value( dc, &ad, &atmp,
NULL, NULL, RWM_MAP ) )
{
goto computed;
......@@ -601,7 +607,8 @@ rwm_int_filter_map_rewrite(
break;
case LDAP_FILTER_PRESENT:
if ( map_attr_value( dc, &f->f_desc, &atmp,
ad = f->f_desc;
if ( map_attr_value( dc, &ad, &atmp,
NULL, NULL, RWM_MAP ) )
{
goto computed;
......@@ -647,7 +654,8 @@ rwm_int_filter_map_rewrite(
case LDAP_FILTER_EXT: {
if ( f->f_mr_desc ) {
if ( map_attr_value( dc, &f->f_mr_desc, &atmp,
ad = f->f_mr_desc;
if ( map_attr_value( dc, &ad, &atmp,
&f->f_mr_value, &vtmp, RWM_MAP ) )
{
goto computed;
......
......@@ -1942,7 +1942,8 @@ typedef enum slap_reply_e {
REP_EXTENDED,
REP_SEARCH,
REP_SEARCHREF,
REP_INTERMEDIATE
REP_INTERMEDIATE,
REP_GLUE_RESULT
} slap_reply_t;
typedef struct rep_sasl_s {
......@@ -2345,6 +2346,19 @@ typedef struct slap_op_header {
#endif
} Opheader;
typedef union slap_op_request {
req_add_s oq_add;
req_bind_s oq_bind;
req_compare_s oq_compare;
req_modify_s oq_modify;
req_modrdn_s oq_modrdn;
req_search_s oq_search;
req_abandon_s oq_abandon;
req_abandon_s oq_cancel;
req_extended_s oq_extended;
req_pwdexop_s oq_pwdexop;
} OpRequest;
typedef struct slap_op {
Opheader *o_hdr;
......@@ -2373,18 +2387,7 @@ typedef struct slap_op {
struct berval o_req_dn; /* DN of target of request */
struct berval o_req_ndn;
union o_req_u {
req_add_s oq_add;
req_bind_s oq_bind;
req_compare_s oq_compare;
req_modify_s oq_modify;
req_modrdn_s oq_modrdn;
req_search_s oq_search;
req_abandon_s oq_abandon;
req_abandon_s oq_cancel;
req_extended_s oq_extended;
req_pwdexop_s oq_pwdexop;
} o_request;
OpRequest o_request;
/* short hands for union members */
#define oq_add o_request.oq_add
......
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