}
if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) && !(
- ( ad->ad_type->sat_approx
+ ad->ad_type->sat_approx
&& ad->ad_type->sat_approx->smr_indexer
- && ad->ad_type->sat_approx->smr_filter )
- && ( ad->ad_type->sat_equality
- && ad->ad_type->sat_equality->smr_indexer
- && ad->ad_type->sat_equality->smr_filter ) ) )
+ && ad->ad_type->sat_approx->smr_filter ) )
{
fprintf( stderr, "%s: line %d: "
"approx index of attribute \"%s\" disallowed\n",
break;
case LDAP_FILTER_APPROX:
- if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) {
- goto done;
+ if ( desc->ad_type->sat_approx ) {
+ if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) {
+ goto done;
+ }
+ break;
}
+
+ /* Use EQUALITY rule and index for approximate match */
/* fall thru */
case LDAP_FILTER_EQUALITY:
}
if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) && !(
- ( ad->ad_type->sat_approx
+ ad->ad_type->sat_approx
&& ad->ad_type->sat_approx->smr_indexer
- && ad->ad_type->sat_approx->smr_filter )
- && ( ad->ad_type->sat_equality
- && ad->ad_type->sat_equality->smr_indexer
- && ad->ad_type->sat_equality->smr_filter ) ) )
+ && ad->ad_type->sat_approx->smr_filter ) )
{
fprintf( stderr, "%s: line %d: "
"approx index of attribute \"%s\" disallowed\n",
break;
case LDAP_FILTER_APPROX:
- if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) {
- goto done;
+ if ( desc->ad_type->sat_approx ) {
+ if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) {
+ goto done;
+ }
+ break;
}
+
+ /* Use EQUALITY rule and index for approximate match */
/* fall thru */
case LDAP_FILTER_EQUALITY:
continue;
}
- for ( bv = a->a_nvals; bv->bv_val != NULL; bv++ )
- {
+ for ( bv = a->a_nvals; bv->bv_val != NULL; bv++ ) {
int ret;
int rc;
const char *text;
case LDAP_FILTER_APPROX:
mr = a->a_desc->ad_type->sat_approx;
if( mr != NULL ) break;
+ /* use EQUALITY matching rule if no APPROX rule */
- /* use EQUALITY matching rule if no APPROX rule */
case LDAP_FILTER_EQUALITY:
mr = a->a_desc->ad_type->sat_equality;
break;
mr = NULL;
}
- if( mr == NULL ) {
- continue;
-
- }
+ if( mr == NULL ) continue;
bv = a->a_nvals;
for ( j=0; bv->bv_val != NULL; bv++, j++ ) {
facsimiletelephonenumber: +1 313 555 2177
telephonenumber: +1 313 555 0355
+dn: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Universit
+ y of Michigan,c=US
+cn: Barbara Jensen
+cn: Babs Jensen
+sn:: IEplbnNlbiA=
+title: Mythical Manager, Research Systems
+
+dn: cn=Bjorn Jensen,ou=Information Technology Division,ou=People,o=University
+ of Michigan,c=US
+cn: Bjorn Jensen
+cn: Biiff Jensen
+sn: Jensen
+title: Director, Embedded Systems
+
dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
member: cn=Manager,o=University of Michigan,c=US
member: cn=Barbara Jensen,ou=Information Technology Division,ou=People,o=Unive
exit $RC
fi
+echo "Testing approximate searching..."
+$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
+ '(sn~=jENSEN)' name >> $SEARCHOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit $RC
+fi
+
echo "Testing OR searching..."
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
'(|(givenname=Xx*yY*Z)(cn=)(undef=*)(objectclass=groupofnames)(sn~=jones)(member=cn=Manager,o=University of Michigan,c=US)(uniqueMember=cn=Manager,o=University of Michigan,c=US))' >> $SEARCHOUT 2>&1
exit $RC
fi
+echo "Testing approximate searching..."
+$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
+ '(sn=jENSEN)' name >> $SEARCHOUT 2>&1
+RC=$?
+if test $RC != 0 ; then
+ echo "ldapsearch failed ($RC)!"
+ test $KILLSERVERS != no && kill -HUP $KILLPIDS
+ exit $RC
+fi
+
echo "Testing OR searching..."
$LDAPSEARCH -C -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT2 \
'(|(objectclass=groupofnames)(objectClass=groupofuniquenames)(sn=jones))' >> $SEARCHOUT 2>&1