static int
rwm_int_filter_map_rewrite(
+ Operation *op,
dncookie *dc,
Filter *f,
struct berval *fstr )
if ( map_attr_value( dc, &f->f_av_desc, &atmp,
&f->f_av_value, &vtmp, RWM_MAP ) )
{
- return -1;
+ goto computed;
}
fstr->bv_len = atmp.bv_len + vtmp.bv_len + STRLENOF( "(=)" );
if ( map_attr_value( dc, &f->f_av_desc, &atmp,
&f->f_av_value, &vtmp, RWM_MAP ) )
{
- return -1;
+ goto computed;
}
fstr->bv_len = atmp.bv_len + vtmp.bv_len + STRLENOF( "(>=)" );
if ( map_attr_value( dc, &f->f_av_desc, &atmp,
&f->f_av_value, &vtmp, RWM_MAP ) )
{
- return -1;
+ goto computed;
}
fstr->bv_len = atmp.bv_len + vtmp.bv_len + STRLENOF( "(<=)" );
if ( map_attr_value( dc, &f->f_av_desc, &atmp,
&f->f_av_value, &vtmp, RWM_MAP ) )
{
- return -1;
+ goto computed;
}
fstr->bv_len = atmp.bv_len + vtmp.bv_len + STRLENOF( "(~=)" );
if ( map_attr_value( dc, &f->f_sub_desc, &atmp,
NULL, NULL, RWM_MAP ) )
{
- return -1;
+ goto computed;
}
/* cannot be a DN ... */
if ( map_attr_value( dc, &f->f_desc, &atmp,
NULL, NULL, RWM_MAP ) )
{
- return -1;
+ goto computed;
}
fstr->bv_len = atmp.bv_len + STRLENOF( "(=*)" );
for ( p = f->f_list; p != NULL; p = p->f_next ) {
len = fstr->bv_len;
- if ( rwm_int_filter_map_rewrite( dc, p, &vtmp ) )
+ if ( rwm_int_filter_map_rewrite( op, dc, p, &vtmp ) )
{
return -1;
}
if ( map_attr_value( dc, &f->f_mr_desc, &atmp,
&f->f_mr_value, &vtmp, RWM_MAP ) )
{
- return -1;
+ goto computed;
}
} else {
break;
}
+ case 0:
+computed:;
+ filter_free_x( op, f );
+ f->f_choice = SLAPD_FILTER_COMPUTED;
+ f->f_result = SLAPD_COMPARE_UNDEFINED;
+ /* fallthru */
+
case SLAPD_FILTER_COMPUTED:
switch ( f->f_result ) {
case LDAP_COMPARE_FALSE:
+ case SLAPD_COMPARE_UNDEFINED:
if ( dc->rwmap->rwm_flags & RWM_F_SUPPORT_T_F ) {
tmp = ber_bvtf_false;
break;
}
- /* fallthru */
-
- case SLAPD_COMPARE_UNDEFINED:
tmp = ber_bvfalse;
break;
int
rwm_filter_map_rewrite(
+ Operation *op,
dncookie *dc,
Filter *f,
struct berval *fstr )
dncookie fdc;
struct berval ftmp;
- rc = rwm_int_filter_map_rewrite( dc, f, fstr );
+ rc = rwm_int_filter_map_rewrite( op, dc, f, fstr );
#ifdef ENABLE_REWRITE
if ( rc != 0 ) {