improve previous commit (ITS#5614)

This commit is contained in:
Pierangelo Masarati 2008-07-14 22:44:01 +00:00
parent 30ffa33d7e
commit 5c53e3ad72
4 changed files with 32 additions and 7 deletions

View File

@ -391,6 +391,17 @@ If
do not return search reference responses.
By default, they are returned unless request is LDAPv2.
.TP
.B noundeffilter <NO|yes>
If
.BR yes ,
return success instead of searching if a filter is undefined or contains
undefined portions.
By default, the search is propagated after replacing undefined portions
with
.BR (!(objectClass=*)) ,
which corresponds to the empty result set.
.TP
.B protocol\-version {0,2,3}
This directive indicates what protocol version must be used to contact

View File

@ -136,6 +136,19 @@ By default, they are returned unless request is LDAPv2.
If set before any target specification, it affects all targets, unless
overridden by any per-target directive.
.TP
.B noundeffilter <NO|yes>
If
.BR yes ,
return success instead of searching if a filter is undefined or contains
undefined portions.
By default, the search is propagated after replacing undefined portions
with
.BR (!(objectClass=*)) ,
which corresponds to the empty result set.
If set before any target specification, it affects all targets, unless
overridden by any per-target directive.
.TP
.B protocol\-version {0,2,3}
This directive indicates what protocol version must be used to contact

View File

@ -94,6 +94,12 @@ ldap_back_munge_filter(
} else if ( strncmp( ptr, bv_undefined.bv_val, bv_undefined.bv_len ) == 0 )
{
/* if undef or invalid filter is not allowed,
* don't rewrite filter */
if ( LDAP_BACK_NOUNDEFFILTER( li ) ) {
return -1;
}
oldbv = &bv_undefined;
newbv = &bv_F;
@ -102,12 +108,6 @@ ldap_back_munge_filter(
goto done;
}
/* if undef or invalid filter is not allowed,
* don't rewrite filter */
if ( LDAP_BACK_NOUNDEFFILTER( li ) ) {
return -1;
}
oldfilter = *filter;
filter->bv_len += newbv->bv_len - oldbv->bv_len;
if ( filter->bv_val == op->ors_filterstr.bv_val ) {

View File

@ -530,14 +530,15 @@ ldap_back_int_filter_map_rewrite(
case SLAPD_FILTER_COMPUTED:
switch ( f->f_result ) {
case LDAP_COMPARE_FALSE:
/* FIXME: treat UNDEFINED as FALSE */
case SLAPD_COMPARE_UNDEFINED:
computed:;
if ( META_BACK_TGT_NOUNDEFFILTER( dc->target ) ) {
return LDAP_COMPARE_FALSE;
}
/* fallthru */
case LDAP_COMPARE_FALSE:
if ( META_BACK_TGT_T_F( dc->target ) ) {
tmp = &ber_bvtf_false;
break;