~asommer/openldap/apport-hook

« back to all changes in this revision

Viewing changes to servers/slapd/back-ldap/search.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug, Steve Langasek, Mathias Gug
  • Date: 2009-03-06 17:34:21 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090306173421-sxlko1f4w5dn4rgw
Tags: 2.4.15-1ubuntu1
[ Steve Langasek ]
* Update priority of libldap-2.4-2 to match the archive override.
* Add the missing ldapexop and ldapurl tools to ldap-utils, as well as the
  ldapurl(1) manpage.  Thanks to Peter Marschall for the patch.
  Closes: #496749.
* Bump build-dependency on debhelper to 6 instead of 5, since that's
  what we're using.  Closes: #498116.
* Set the default SLAPD_SERVICES to ldap:/// ldapi:///, instead of using
  the built-in default of ldap:/// only.

[ Mathias Gug ]
* Merge from debian unstable, remaining changes:
  - Modify Maintainer value to match the DebianMaintainerField
    speficication.
  - AppArmor support:
    - 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.
    - 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/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).
  - Enable nssoverlay:
    - 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.
* Dropped:
  - debian/patches/corrupt-contextCSN: The contextCSN can get corrupted at
    times. (ITS: #5947) Fixed in new upstream version 2.4.15.
  - debian/patches/fix-ucred-libc due to changes how newer glibc handle
    the ucred struct now. Implemented in Debian.
* debian/patches/fix-ldap_back_entry_get_rwa.patch: fix test-0034 failure
  when built with PIE.
* debian/patches/gnutls-enable-v1-ca-certs: Enable V1 CA certs to be
  trusted (LP: #305264).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* search.c - ldap backend search function */
2
 
/* $OpenLDAP: pkg/ldap/servers/slapd/back-ldap/search.c,v 1.201.2.18 2009/02/11 00:20:01 quanah Exp $ */
 
2
/* $OpenLDAP: pkg/ldap/servers/slapd/back-ldap/search.c,v 1.201.2.19 2009/02/20 01:15:05 quanah Exp $ */
3
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4
4
 *
5
5
 * Copyright 1999-2009 The OpenLDAP Foundation.
428
428
                         * are passed without checks */
429
429
                        rc = ldap_parse_intermediate( lc->lc_ld,
430
430
                                res,
431
 
                                &rs->sr_rspoid,
 
431
                                (char **)&rs->sr_rspoid,
432
432
                                &rs->sr_rspdata,
433
433
                                &rs->sr_ctrls,
434
434
                                0 );
439
439
                        slap_send_ldap_intermediate( op, rs );
440
440
 
441
441
                        if ( rs->sr_rspoid != NULL ) {
442
 
                                ber_memfree( rs->sr_rspoid );
 
442
                                ber_memfree( (char *)rs->sr_rspoid );
443
443
                                rs->sr_rspoid = NULL;
444
444
                        }
445
445
 
729
729
                        goto next_attr;
730
730
                }
731
731
 
732
 
                for ( i = 0; !BER_BVISNULL( &attr->a_vals[i] ); i++ ) {
 
732
                for ( i = 0; !BER_BVISNULL( &attr->a_vals[i] ); i++ ) ;
 
733
                last = i;
 
734
 
 
735
                for ( i = 0; i<last; i++ ) {
733
736
                        struct berval   pval;
734
737
                        int             rc;
735
738
 
752
755
                                        ber_dupbv( &pval, &oc->soc_cname );
753
756
 
754
757
                                } else {
755
 
                                        attr->a_nvals = NULL;
756
 
                                        attr_free( attr );
757
 
                                        goto next_attr;
 
758
                                        LBER_FREE( attr->a_vals[i].bv_val );
 
759
                                        if ( --last == i ) {
 
760
                                                BER_BVZERO( &attr->a_vals[i] );
 
761
                                                break;
 
762
                                        }
 
763
                                        attr->a_vals[i] = attr->a_vals[last];
 
764
                                        BER_BVZERO( &attr->a_vals[last] );
758
765
                                }
759
 
                        }
760
 
 
761
 
                        if ( pretty ) {
 
766
                        } else if ( pretty ) {
762
767
                                LBER_FREE( attr->a_vals[i].bv_val );
763
768
                                attr->a_vals[i] = pval;
764
769
                        }
765
770
                }
766
771
                attr->a_numvals = last = i;
 
772
                if ( last == 0 && attr->a_vals != &slap_dummy_bv ) {
 
773
                        attr->a_nvals = NULL;
 
774
                        attr_free( attr );
 
775
                        goto next_attr;
 
776
                }
767
777
 
768
778
                if ( last && attr->a_desc->ad_type->sat_equality &&
769
779
                                attr->a_desc->ad_type->sat_equality->smr_normalize )
784
794
                                        NULL );
785
795
 
786
796
                                if ( rc != LDAP_SUCCESS ) {
787
 
                                        BER_BVZERO( &attr->a_nvals[i] );
788
 
                                        attr_free( attr );
789
 
                                        goto next_attr;
 
797
                                        LBER_FREE( attr->a_vals[i].bv_val );
 
798
                                        if ( --last == i ) {
 
799
                                                BER_BVZERO( &attr->a_vals[i] );
 
800
                                                break;
 
801
                                        }
 
802
                                        attr->a_vals[i] = attr->a_vals[last];
 
803
                                        BER_BVZERO( &attr->a_vals[last] );
790
804
                                }
791
805
                        }
792
806
                        BER_BVZERO( &attr->a_nvals[i] );
 
807
                        if ( last == 0 ) {
 
808
                                attr_free( attr );
 
809
                                goto next_attr;
 
810
                        }
793
811
 
794
812
                } else {
795
813
                        attr->a_nvals = attr->a_vals;
796
814
                }
 
815
 
 
816
                attr->a_numvals = last;
797
817
                *attrp = attr;
798
818
                attrp = &attr->a_next;
799
819