[Date Prev][Date Next] [Chronological] [Thread] [Top]

Present filters on unrecognized attribute types (ITS#1439)



Full_Name: Bob Pepin
Version: 2.0.17
OS: Linux
URL: http://sorry.didnt.bother.com/
Submission from: (NULL) (194.235.201.249)


When slapd finds a present filter with an invalid attribute it evaluates to
UNDEFINED for that filter instead of FALSE. From rfc2251:

     The present match evaluates to TRUE where there is an attribute or
     subtype of the specified attribute description present in an entry,
     and FALSE otherwise (including a presence test with an unrecognized
     attribute description.)

Here's the diff:
--- openldap-2.0.17/servers/slapd.orig/filter.c Fri Aug 31 22:24:17 2001
+++ openldap-2.0.17/servers/slapd/filter.c      Tue Nov 13 10:13:56 2001
@@ -183,6 +183,10 @@
                err = slap_bv2ad( &type, &f->f_desc, text );

                if( err != LDAP_SUCCESS ) {
+                /* unknown attributes evaluate to false */
+                       f->f_choice = SLAPD_FILTER_COMPUTED;
+                       f->f_result = LDAP_COMPARE_FALSE;
+                       err = LDAP_SUCCESS;
                        ch_free( type.bv_val );
                        break;
                }