From: Pierangelo Masarati Date: Fri, 16 Dec 2005 22:27:57 +0000 (+0000) Subject: do exactly what requested X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~562 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7941652ed455ba3cdbe05b2daf1fd23ca64fb2db;p=openldap do exactly what requested --- diff --git a/servers/slapd/slapdn.c b/servers/slapd/slapdn.c index 0119e7fab5..96ddf9a162 100644 --- a/servers/slapd/slapdn.c +++ b/servers/slapd/slapdn.c @@ -46,12 +46,26 @@ slapdn( int argc, char **argv ) argc -= optind; for ( ; argc--; argv++ ) { - struct berval dn, pdn, ndn; + struct berval dn, + pdn = BER_BVNULL, + ndn = BER_BVNULL; ber_str2bv( argv[ 0 ], 0, 0, &dn ); - rc = dnPrettyNormal( NULL, &dn, - &pdn, &ndn, NULL ); + switch ( dn_mode ) { + case SLAP_TOOL_LDAPDN_PRETTY: + rc = dnPretty( NULL, &dn, &pdn, NULL ); + break; + + case SLAP_TOOL_LDAPDN_NORMAL: + rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, NULL ); + break; + + default: + rc = dnPrettyNormal( NULL, &dn, &pdn, &ndn, NULL ); + break; + } + if ( rc != LDAP_SUCCESS ) { fprintf( stderr, "DN: <%s> check failed %d (%s)\n", dn.bv_val, rc,