mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 11:09:34 -05:00
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:
parent
184f647b25
commit
b1b8d9d651
1 changed files with 23 additions and 17 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue