Diff for /servers/slapd/filter.c between versions 1.134.2.6 and 1.141

version 1.134.2.6, 2007/10/05 06:25:03 version 1.141, 2007/02/20 22:08:09
Line 1 Line 1
 /* filter.c - routines for parsing and dealing with filters */  /* filter.c - routines for parsing and dealing with filters */
 /* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.134.2.5 2007/09/27 21:38:25 ralf Exp $ */  /* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.140 2007/01/02 19:01:04 kurt Exp $ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.  /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *   *
  * Copyright 1998-2007 The OpenLDAP Foundation.   * Copyright 1998-2007 The OpenLDAP Foundation.
Line 32 Line 32
 #include <ac/string.h>  #include <ac/string.h>
   
 #include "slap.h"  #include "slap.h"
 #include "lutil.h"  
   
 const Filter *slap_filter_objectClass_pres;  
 const struct berval *slap_filterstr_objectClass_pres;  
   
 static int      get_filter_list(  static int      get_filter_list(
         Operation *op,          Operation *op,
Line 61  static int get_simple_vrFilter( Line 57  static int get_simple_vrFilter(
         const char **text );          const char **text );
   
 int  int
 filter_init( void )  
 {  
         static Filter filter_objectClass_pres = { LDAP_FILTER_PRESENT };  
         static struct berval filterstr_objectClass_pres = BER_BVC("(objectClass=*)");  
   
         filter_objectClass_pres.f_desc = slap_schema.si_ad_objectClass;  
   
         slap_filter_objectClass_pres = &filter_objectClass_pres;  
         slap_filterstr_objectClass_pres = &filterstr_objectClass_pres;  
   
         return 0;  
 }  
   
 void  
 filter_destroy( void )  
 {  
         return;  
 }  
   
 int  
 get_filter(  get_filter(
         Operation *op,          Operation *op,
         BerElement *ber,          BerElement *ber,
Line 568  filter2bv_x( Operation *op, Filter *f, s Line 544  filter2bv_x( Operation *op, Filter *f, s
         int             i;          int             i;
         Filter          *p;          Filter          *p;
         struct berval   tmp;          struct berval   tmp;
         char            uuid[ LDAP_LUTIL_UUIDSTR_BUFSIZE ];  
         static struct berval          static struct berval
                         ber_bvfalse = BER_BVC( "(?=false)" ),                          ber_bvfalse = BER_BVC( "(?=false)" ),
                         ber_bvtrue = BER_BVC( "(?=true)" ),                          ber_bvtrue = BER_BVC( "(?=true)" ),
Line 593  filter2bv_x( Operation *op, Filter *f, s Line 568  filter2bv_x( Operation *op, Filter *f, s
         case LDAP_FILTER_EQUALITY:          case LDAP_FILTER_EQUALITY:
                 fstr->bv_len = STRLENOF("(=)");                  fstr->bv_len = STRLENOF("(=)");
                 sign = "=";                  sign = "=";
                 if ( f->f_av_desc->ad_type->sat_syntax == slap_schema.si_ad_entryUUID->ad_type->sat_syntax ) {  
                         tmp.bv_len = lutil_uuidstr_from_normalized( f->f_av_value.bv_val,  
                                 f->f_av_value.bv_len, uuid, LDAP_LUTIL_UUIDSTR_BUFSIZE );  
                         assert( tmp.bv_len > 0 );  
                         tmp.bv_val = uuid;  
                         goto escaped;  
                 }  
                 goto simple;                  goto simple;
         case LDAP_FILTER_GE:          case LDAP_FILTER_GE:
                 fstr->bv_len = STRLENOF("(>=)");                  fstr->bv_len = STRLENOF("(>=)");
Line 620  simple: Line 588  simple:
                  * to have been normalized, meaning that an empty value                   * to have been normalized, meaning that an empty value
                  * is legal for that attribute's syntax */                   * is legal for that attribute's syntax */
   
 escaped:  
                 fstr->bv_len += f->f_av_desc->ad_cname.bv_len + tmp.bv_len;                  fstr->bv_len += f->f_av_desc->ad_cname.bv_len + tmp.bv_len;
                 if ( undef )                  if ( undef )
                         fstr->bv_len++;                          fstr->bv_len++;

Removed from v.1.134.2.6  
changed lines
  Added in v.1.141


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org