~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to servers/slapd/filter.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-09-07 13:41:10 UTC
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: james.westby@ubuntu.com-20090907134110-jsdrvn0atu1fex4m
Tags: upstream-2.4.18
ImportĀ upstreamĀ versionĀ 2.4.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* filter.c - routines for parsing and dealing with filters */
2
 
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.134.2.16 2009/01/22 00:01:01 kurt Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.134.2.17 2009/08/13 00:48:32 quanah Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
5
 * Copyright 1998-2009 The OpenLDAP Foundation.
348
348
{
349
349
        ber_tag_t       tag;
350
350
        ber_len_t       len;
351
 
        ber_tag_t       rc;
 
351
        int     rc;
352
352
        struct berval desc, value, nvalue;
353
353
        char            *last;
354
354
        SubstringsAssertion ssa;
385
385
 
386
386
        rc = LDAP_PROTOCOL_ERROR;
387
387
 
 
388
        /* If there is no substring matching rule, there's nothing
 
389
         * we can do with this filter. But we continue to parse it
 
390
         * for logging purposes.
 
391
         */
388
392
        if ( ssa.sa_desc->ad_type->sat_substr == NULL ) {
389
 
                for ( tag = ber_first_element( ber, &len, &last );
390
 
                        tag != LBER_DEFAULT;
391
 
                        tag = ber_next_element( ber, &len, last ) )
392
 
                {
393
 
                        /* eat all */
394
 
                        rc = ber_scanf( ber, "x" );
395
 
                }
396
 
 
397
 
                rc = LDAP_INVALID_SYNTAX;
398
 
                goto return_error;
 
393
                f->f_choice |= SLAPD_FILTER_UNDEFINED;
 
394
                Debug( LDAP_DEBUG_FILTER,
 
395
                "get_ssa: no substring matching rule for attributeType %s\n",
 
396
                        desc.bv_val, 0, 0 );
399
397
        }
400
398
 
401
399
        for ( tag = ber_first_element( ber, &len, &last );
457
455
                rc = asserted_value_validate_normalize(
458
456
                        ssa.sa_desc, ssa.sa_desc->ad_type->sat_equality,
459
457
                        usage, &value, &nvalue, text, op->o_tmpmemctx );
460
 
                if( rc != LDAP_SUCCESS ) goto return_error;
 
458
                if( rc != LDAP_SUCCESS ) {
 
459
                        f->f_choice |= SLAPD_FILTER_UNDEFINED;
 
460
                        Debug( LDAP_DEBUG_FILTER,
 
461
                        "get_ssa: illegal value for attributeType %s (%d) %s\n",
 
462
                                desc.bv_val, rc, *text );
 
463
                        ber_dupbv_x( &nvalue, &value, op->o_tmpmemctx );
 
464
                }
461
465
 
462
466
                switch ( tag ) {
463
467
                case LDAP_SUBSTRING_INITIAL: