]> git.sur5r.net Git - openldap/commitdiff
do exactly what requested
authorPierangelo Masarati <ando@openldap.org>
Fri, 16 Dec 2005 22:27:57 +0000 (22:27 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 16 Dec 2005 22:27:57 +0000 (22:27 +0000)
servers/slapd/slapdn.c

index 0119e7fab595d4cf500938204fcb1ea57db3e378..96ddf9a16239d2e8524bdd35a6e663e72ca4bfad 100644 (file)
@@ -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,