~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, Steve Langasek, Mathias Gug
  • Date: 2009-02-18 18:44:00 UTC
  • mfrom: (1.1.2 upstream) (0.1.2 lenny)
  • Revision ID: james.westby@ubuntu.com-20090218184400-zw4mjse9eywt5566
Tags: 2.4.14-0ubuntu1
[ Steve Langasek ]
* New upstream version
  - Fixes a bug with the pcache overlay not returning cached entries
    (closes: #497697)
  - Update evolution-ntlm patch to apply to current Makefiles.
  - (tentatively) drop gnutls-ciphers, since this bug was reported to be
    fixed upstream in 2.4.8.  The fix applied in 2.4.8 didn't match the
    patch from the bug report, so this should be watched for regressions.
* Build against db4.7 instead of db4.2 at last!  Closes: #421946.
* Build with --disable-ndb, to avoid a misbuild when libmysqlclient is
  installed in the build environment.
* New patch, no-crlcheck-for-gnutls, to fix a build failure when using
  --with-tls=gnutls.

[ Mathias Gug ]
* Merge from debian unstable, remaining changes:
  - debian/apparmor-profile: add AppArmor profile
  - debian/slapd.postinst: Reload AA profile on configuration
  - updated debian/slapd.README.Debian for note on AppArmor
  - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6
  - debian/control: Conflicts with apparmor-profiles << 2.1+1075-0ubuntu4
    to make sure that if earlier version of apparmour-profiles gets
    installed it won't overwrite our profile.
  - Modify Maintainer value to match the DebianMaintainerField
    speficication.
  - follow ApparmorProfileMigration and force apparmor compalin mode on 
    some upgrades (LP: #203529)
  - debian/slapd.dirs: add etc/apparmor.d/force-complain
  - debian/slapd.preinst: create symlink for force-complain on pre-feisty
    upgrades, upgrades where apparmor-profiles profile is unchanged (ie
    non-enforcing) and upgrades where apparmor profile does not exist.
  - debian/slapd.postrm: remove symlink in force-complain/ on purge
  - debian/patches/fix-ucred-libc due to changes how newer glibc handle
    the ucred struct now.
  - debian/control:
    - Build-depend on libltdl7-dev rather then libltdl3-dev.
  - debian/patches/autogen.sh:
    - Call libtoolize with the --install option to install config.{guess,sub}
      files.
  - Don't use local statement in config script as it fails if /bin/sh
    points to bash (LP: #286063).
  - Disable the testsuite on hppa. Allows building of packages on this
    architecture again, once this package is in the archive.
    LP: #288908.
  - debian/slapd.postinst, debian/slapd.script-common: set correct ownership
    and permissions on /var/lib/ldap, /etc/ldap/slapd.d (group readable) and
    /var/run/slapd (world readable). (LP: #257667).
  - debian/patches/nssov-build, debian/rules: 
    Build and package the nss overlay.
    debian/schema/misc.ldif: add ldif file for the misc schema, which defines
    rfc822MailMember (required by the nss overlay).
  - debian/{control,rules}: enable PIE hardening
  - Use cn=config as the default configuration backend instead of 
    slapd.conf. Migrate slapd.conf  file to /etc/ldap/slapd.d/ on upgrade
    asking the end user to enter a new password to control the access to the
    cn=config tree.
* debian/patches/corrupt-contextCSN: The contextCSN can get corrupted at
  times. (ITS: #5947)

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.12 2008/02/18 22:25:47 hyc Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.134.2.16 2009/01/22 00:01:01 kurt Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
 
 * Copyright 1998-2008 The OpenLDAP Foundation.
 
5
 * Copyright 1998-2009 The OpenLDAP Foundation.
6
6
 * All rights reserved.
7
7
 *
8
8
 * Redistribution and use in source and binary forms, with or without
385
385
 
386
386
        rc = LDAP_PROTOCOL_ERROR;
387
387
 
 
388
        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;
 
399
        }
 
400
 
388
401
        for ( tag = ber_first_element( ber, &len, &last );
389
402
                tag != LBER_DEFAULT;
390
403
                tag = ber_next_element( ber, &len, last ) )
478
491
                        return rc;
479
492
                }
480
493
 
 
494
                *text = NULL;
481
495
                rc = LDAP_SUCCESS;
482
496
        }
483
497
 
491
505
}
492
506
 
493
507
void
494
 
filter_free_x( Operation *op, Filter *f )
 
508
filter_free_x( Operation *op, Filter *f, int freeme )
495
509
{
496
510
        Filter  *p, *next;
497
511
 
530
544
        case LDAP_FILTER_NOT:
531
545
                for ( p = f->f_list; p != NULL; p = next ) {
532
546
                        next = p->f_next;
533
 
                        filter_free_x( op, p );
 
547
                        filter_free_x( op, p, 1 );
534
548
                }
535
549
                break;
536
550
 
547
561
                break;
548
562
        }
549
563
 
550
 
        op->o_tmpfree( f, op->o_tmpmemctx );
 
564
        if ( freeme ) {
 
565
                op->o_tmpfree( f, op->o_tmpmemctx );
 
566
        }
551
567
}
552
568
 
553
569
void
559
575
        op.o_hdr = &ohdr;
560
576
        op.o_tmpmemctx = slap_sl_context( f );
561
577
        op.o_tmpmfuncs = &slap_sl_mfuncs;
562
 
        filter_free_x( &op, f );
 
578
        filter_free_x( &op, f, 1 );
563
579
}
564
580
 
565
581
void