From: Pierangelo Masarati Date: Wed, 11 Jul 2001 20:16:25 +0000 (+0000) Subject: honors multiple type/value in rdn when generating ufn X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1240 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=93923d43454885e7a31447c8dc6695335cb48aa5;p=openldap honors multiple type/value in rdn when generating ufn --- diff --git a/libraries/libldap/getdn.c b/libraries/libldap/getdn.c index e81b9412be..90be475553 100644 --- a/libraries/libldap/getdn.c +++ b/libraries/libldap/getdn.c @@ -56,6 +56,7 @@ ldap_dn2ufn( LDAP_CONST char *dn ) { char *ufn; char **vals; + int i; Debug( LDAP_DEBUG_TRACE, "ldap_dn2ufn\n", 0, 0, 0 ); @@ -65,11 +66,25 @@ ldap_dn2ufn( LDAP_CONST char *dn ) return NULL; } - vals = ldap_explode_dn( dn , 1 ); + vals = ldap_explode_dn( dn , 0 ); if( vals == NULL ) { return NULL; } + for ( i = 0; vals[i]; i++ ) { + char **rvals; + + rvals = ldap_explode_rdn( vals[i] , 1 ); + if ( rvals == NULL ) { + LDAP_VFREE( vals ); + return NULL; + } + + LDAP_FREE( vals[i] ); + vals[i] = ldap_charray2str( rvals, " + " ); + LDAP_VFREE( rvals ); + } + ufn = ldap_charray2str( vals, ", " ); LDAP_VFREE( vals );