/* dn.c - routines for dealing with distinguished names */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
slap_syntax_transform_func *transf = NULL;
MatchingRule *mr;
struct berval bv = { 0, NULL };
+ int do_sort = 0;
assert( ava );
}
ava->la_private = ( void * )ad;
+ do_sort = 1;
}
/*
char *s = bv.bv_val;
ber_str2bv( UTF8normalize( bv.bv_val ? &bv
- : &ava->la_value, UTF8_CASEFOLD ),
+ : &ava->la_value, LDAP_UTF8_CASEFOLD ),
0, 0, &bv );
free( s );
}
ava->la_value = bv;
}
- AVA_Sort( rdn, iAVA );
+ if( do_sort ) AVA_Sort( rdn, iAVA );
}
}
const char *p;
int rc;
- rc = ldap_str2rdn( dn, NULL, &p, LDAP_DN_FORMAT_LDAP | LDAP_DN_SKIP );
+ rc = ldap_str2rdn( dn, NULL, (char **)&p,
+ LDAP_DN_FORMAT_LDAP | LDAP_DN_SKIP );
if ( rc != LDAP_SUCCESS ) {
return rc;
}
+ /* Parent is root */
+ if (*p == '\0') {
+ *pdn = "";
+ return LDAP_SUCCESS;
+ }
+
assert( DN_SEPARATOR( p[ 0 ] ) );
p++;
return LDAP_OTHER;
}
- rc = ldap_str2rdn( dn->bv_val, &tmpRDN, &p, LDAP_DN_FORMAT_LDAP );
+ rc = ldap_str2rdn( dn->bv_val, &tmpRDN, (char **)&p, LDAP_DN_FORMAT_LDAP );
if ( rc != LDAP_SUCCESS ) {
return rc;
}
return 0;
}
- rc = ldap_str2rdn( dn_in->bv_val, NULL, &p,
+ rc = ldap_str2rdn( dn_in->bv_val, NULL, (char **)&p,
LDAP_DN_FORMAT_LDAP | LDAP_DN_SKIP );
if ( rc != LDAP_SUCCESS ) {
return 0;
assert( *values == NULL );
assert( types == NULL || *types == NULL );
- rc = ldap_str2rdn( rdn, &tmpRDN, &p, LDAP_DN_FORMAT_LDAP );
+ rc = ldap_str2rdn( rdn, &tmpRDN, (char **)&p, LDAP_DN_FORMAT_LDAP );
if ( rc != LDAP_SUCCESS ) {
return rc;
}
/*
* must be parsable
*/
- rc = ldap_str2rdn( rdn, &RDN, &p, LDAP_DN_FORMAT_LDAP );
+ rc = ldap_str2rdn( rdn, &RDN, (char **)&p, LDAP_DN_FORMAT_LDAP );
if ( rc != LDAP_SUCCESS ) {
return 0;
}