version 1.134.2.4, 2007/09/27 21:14:23
|
version 1.134.2.7, 2007/10/05 06:34:26
|
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.3 2007/08/31 23:13:59 quanah Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.134.2.6 2007/10/05 06:25:03 ando 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 Filter *slap_filter_objectClass_pres; |
const struct berval *slap_filterstr_objectClass_pres; |
const struct berval *slap_filterstr_objectClass_pres; |
Line 591 filter2bv_x( Operation *op, Filter *f, s
|
Line 592 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_val = op->o_tmpalloc( LDAP_LUTIL_UUIDSTR_BUFSIZE, op->o_tmpmemctx ); |
|
tmp.bv_len = lutil_uuidstr_from_normalized( f->f_av_value.bv_val, |
|
f->f_av_value.bv_len, tmp.bv_val, LDAP_LUTIL_UUIDSTR_BUFSIZE ); |
|
assert( tmp.bv_len > 0 ); |
|
goto escaped; |
|
} |
goto simple; |
goto simple; |
case LDAP_FILTER_GE: |
case LDAP_FILTER_GE: |
fstr->bv_len = STRLENOF("(>=)"); |
fstr->bv_len = STRLENOF("(>=)"); |
Line 611 simple:
|
Line 619 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++; |