slapi_dn_normalize() should pretty DN; slapi_dn_normalize_case() should normalize it

(appears to be correct based on iPlanet documentation)
This commit is contained in:
Luke Howard 2003-04-23 11:29:11 +00:00
parent 184f647b25
commit b1b8d9d651

View file

@ -848,6 +848,28 @@ slapi_attr_get_values(
char *
slapi_dn_normalize( char *dn )
{
#ifdef LDAP_SLAPI
struct berval bdn;
struct berval pdn;
assert( dn != NULL );
bdn.bv_val = dn;
bdn.bv_len = strlen( dn );
if ( dnPretty2( NULL, &bdn, &pdn, NULL ) != LDAP_SUCCESS ) {
return NULL;
}
return pdn.bv_val;
#else /* LDAP_SLAPI */
return NULL;
#endif /* LDAP_SLAPI */
}
char *
slapi_dn_normalize_case( char *dn )
{
#ifdef LDAP_SLAPI
struct berval bdn;
struct berval ndn;
@ -861,23 +883,7 @@ slapi_dn_normalize( char *dn )
return NULL;
}
/*
* FIXME: ain't it safe to set dn = ndn.bv_val ?
*/
dn = ch_strdup( ndn.bv_val );
ch_free( ndn.bv_val );
return dn;
#else /* LDAP_SLAPI */
return NULL;
#endif /* LDAP_SLAPI */
}
char *
slapi_dn_normalize_case( char *dn )
{
#ifdef LDAP_SLAPI
return slapi_dn_normalize( dn );
return ndn.bv_val;
#else /* LDAP_SLAPI */
return NULL;
#endif /* LDAP_SLAPI */