mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-30 03:29:35 -05:00
do exactly what requested
This commit is contained in:
parent
ce3c024557
commit
7941652ed4
1 changed files with 17 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue