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

« back to all changes in this revision

Viewing changes to servers/slapd/back-meta/bind.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
 
/* $OpenLDAP: pkg/ldap/servers/slapd/back-meta/bind.c,v 1.95.2.15 2008/04/14 21:24:34 quanah Exp $ */
 
1
/* $OpenLDAP: pkg/ldap/servers/slapd/back-meta/bind.c,v 1.95.2.18 2009/01/22 00:01:07 kurt Exp $ */
2
2
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3
3
 *
4
 
 * Copyright 1999-2008 The OpenLDAP Foundation.
 
4
 * Copyright 1999-2009 The OpenLDAP Foundation.
5
5
 * Portions Copyright 2001-2003 Pierangelo Masarati.
6
6
 * Portions Copyright 1999-2003 Howard Chu.
7
7
 * All rights reserved.
953
953
                metatarget_t            *mt = mi->mi_targets[ candidate ];
954
954
                metasingleconn_t        *msc = &mc->mc_conns[ candidate ];
955
955
 
956
 
#define ERR_OK(err) ((err) == LDAP_SUCCESS || (err) == LDAP_COMPARE_FALSE || (err) == LDAP_COMPARE_TRUE)
957
 
 
958
 
                if ( ERR_OK( rs->sr_err ) ) {
 
956
                if ( LDAP_ERR_OK( rs->sr_err ) ) {
959
957
                        int             rc;
960
958
                        struct timeval  tv;
961
959
                        LDAPMessage     *res = NULL;
1087
1085
                /* if the error in the reply structure is not
1088
1086
                 * LDAP_SUCCESS, try to map it from client 
1089
1087
                 * to server error */
1090
 
                if ( !ERR_OK( rs->sr_err ) ) {
 
1088
                if ( !LDAP_ERR_OK( rs->sr_err ) ) {
1091
1089
                        rs->sr_err = slap_map_api2result( rs );
1092
1090
 
1093
1091
                        /* internal ops ( op->o_conn == NULL ) 
1206
1204
                rs->sr_matched = matched;
1207
1205
        }
1208
1206
 
1209
 
        if ( op->o_conn &&
1210
 
                ( ( sendok & LDAP_BACK_SENDOK ) 
1211
 
                        || ( ( sendok & LDAP_BACK_SENDERR ) && rs->sr_err != LDAP_SUCCESS ) ) )
 
1207
        if ( rs->sr_err == LDAP_UNAVAILABLE ) {
 
1208
                if ( !( sendok & LDAP_BACK_RETRYING ) ) {
 
1209
                        if ( op->o_conn && ( sendok & LDAP_BACK_SENDERR ) ) {
 
1210
                                if ( rs->sr_text == NULL ) rs->sr_text = "Proxy operation retry failed";
 
1211
                                send_ldap_result( op, rs );
 
1212
                        }
 
1213
                }
 
1214
 
 
1215
        } else if ( op->o_conn &&
 
1216
                ( ( ( sendok & LDAP_BACK_SENDOK ) && LDAP_ERR_OK( rs->sr_err ) )
 
1217
                        || ( ( sendok & LDAP_BACK_SENDERR ) && !LDAP_ERR_OK( rs->sr_err ) ) ) )
1212
1218
        {
1213
1219
                send_ldap_result( op, rs );
1214
1220
        }
1235
1241
        rs->sr_ref = save_ref;
1236
1242
        rs->sr_ctrls = save_ctrls;
1237
1243
 
1238
 
        return( ERR_OK( rs->sr_err ) ? LDAP_SUCCESS : rs->sr_err );
 
1244
        return( LDAP_ERR_OK( rs->sr_err ) ? LDAP_SUCCESS : rs->sr_err );
1239
1245
}
1240
1246
 
1241
1247
/*
1575
1581
 
1576
1582
        LDAPControl             **ctrls = NULL;
1577
1583
        /* set to the maximum number of controls this backend can add */
1578
 
        LDAPControl             c[ 2 ] = { 0 };
 
1584
        LDAPControl             c[ 2 ] = {{ 0 }};
1579
1585
        int                     n = 0, i, j1 = 0, j2 = 0;
1580
1586
 
1581
1587
        *pctrls = NULL;
1642
1648
                goto done;
1643
1649
        }
1644
1650
 
1645
 
        assert( j1 + j1 <= sizeof( c )/sizeof(LDAPControl) );
 
1651
        assert( j1 + j2 <= (int) (sizeof( c )/sizeof( c[0] )) );
1646
1652
 
1647
1653
        if ( op->o_ctrls ) {
1648
1654
                for ( n = 0; op->o_ctrls[ n ]; n++ )