From 7941652ed455ba3cdbe05b2daf1fd23ca64fb2db Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Fri, 16 Dec 2005 22:27:57 +0000 Subject: [PATCH] do exactly what requested --- servers/slapd/slapdn.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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, -- 2.39.5