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

« back to all changes in this revision

Viewing changes to libraries/librewrite/xmap.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/libraries/librewrite/xmap.c,v 1.12.2.3 2008/02/11 23:26:43 kurt Exp $ */
 
1
/* $OpenLDAP: pkg/ldap/libraries/librewrite/xmap.c,v 1.12.2.5 2009/01/22 00:00:59 kurt Exp $ */
2
2
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3
3
 *
4
 
 * Copyright 2000-2008 The OpenLDAP Foundation.
 
4
 * Copyright 2000-2009 The OpenLDAP Foundation.
5
5
 * All rights reserved.
6
6
 *
7
7
 * Redistribution and use in source and binary forms, with or without
74
74
        if ( strncasecmp(s, "xpasswd", 7 ) == 0 ) {
75
75
                map->lm_type = REWRITE_MAP_XPWDMAP;
76
76
                map->lm_name = strdup( "xpasswd" );
 
77
                if ( map->lm_name == NULL ) {
 
78
                        free( map );
 
79
                        return NULL;
 
80
                }
77
81
 
78
82
                assert( s[7] == '}' );
79
83
                *currpos = s + 8;
123
127
 
124
128
                l = p - s - c;
125
129
                filename = calloc( sizeof( char ), l + 1 );
 
130
                if ( filename == NULL ) {
 
131
                        free( map );
 
132
                        return NULL;
 
133
                }
126
134
                AC_MEMCPY( filename, s + c, l );
127
135
                filename[ l ] = '\0';
128
136
                
177
185
                 */
178
186
                l = p - s - c;
179
187
                url = calloc( sizeof( char ), l + 3 );
 
188
                if ( url == NULL ) {
 
189
                        free( map );
 
190
                        return NULL;
 
191
                }
180
192
                AC_MEMCPY( url, s + c, l );
181
193
                url[ l ] = '\0';
182
194
 
269
281
                        int l = strlen( pwd->pw_gecos );
270
282
                        
271
283
                        val->bv_val = strdup( pwd->pw_gecos );
272
 
                        if ( val->bv_val == NULL ) {
273
 
 
274
 
#ifdef USE_REWRITE_LDAP_PVT_THREADS
275
 
                                ldap_pvt_thread_mutex_unlock( &xpasswd_mutex );
276
 
#endif /* USE_REWRITE_LDAP_PVT_THREADS */
277
 
 
278
 
                                rc = REWRITE_ERR;
279
 
                                break;
280
 
                        }
281
284
                        val->bv_len = l;
282
285
                } else
283
286
#endif /* HAVE_STRUCT_PASSWD_PW_GECOS */
289
292
#ifdef USE_REWRITE_LDAP_PVT_THREADS
290
293
                ldap_pvt_thread_mutex_unlock( &xpasswd_mutex );
291
294
#endif /* USE_REWRITE_LDAP_PVT_THREADS */
292
 
                        
 
295
 
 
296
                if ( val->bv_val == NULL ) {
 
297
                        rc = REWRITE_ERR;
 
298
                }
293
299
                break;
294
300
        }
295
301
#endif /* HAVE_GETPWNAM*/
400
406
                }
401
407
                if ( attrsonly == 1 ) {
402
408
                        val->bv_val = ldap_get_dn( ld, entry );
403
 
                        if ( val->bv_val == NULL ) {
404
 
                                ldap_msgfree( res );
405
 
                                ldap_unbind( ld );
406
 
                                rc = REWRITE_ERR;
407
 
                                goto rc_return;
408
 
                        }
 
409
 
409
410
                } else {
410
411
                        values = ldap_get_values( ld, entry,
411
412
                                        lud->lud_attrs[0] );
412
 
                        if ( values == NULL ) {
413
 
                                ldap_msgfree( res );
414
 
                                ldap_unbind( ld );
415
 
                                rc = REWRITE_ERR;
416
 
                                goto rc_return;
 
413
                        if ( values != NULL ) {
 
414
                                val->bv_val = strdup( values[ 0 ] );
 
415
                                ldap_value_free( values );
417
416
                        }
418
 
                        val->bv_val = strdup( values[ 0 ] );
419
 
                        ldap_value_free( values );
420
417
                }
421
 
                val->bv_len = strlen( val->bv_val );
422
418
 
423
419
                ldap_msgfree( res );
424
420
                ldap_unbind( ld );
425
421
                
 
422
                if ( val->bv_val == NULL ) {
 
423
                        rc = REWRITE_ERR;
 
424
                        goto rc_return;
 
425
                }
 
426
                val->bv_len = strlen( val->bv_val );
 
427
 
426
428
                rc = REWRITE_SUCCESS;
427
 
        }
 
429
        } break;
428
430
        }
429
431
 
430
432
rc_return:;