/* create exactly the required entry */
- if ( dnExtractRdn( ndn->bv_val, &rdn ) != LDAP_SUCCESS ) {
+ if ( dnExtractRdn( ndn, &rdn ) != LDAP_SUCCESS ) {
return( -1 );
}
int
dnExtractRdn(
- const char *dn,
+ struct berval *dn,
struct berval **rdn )
{
LDAPRDN *tmpRDN;
assert( dn );
assert( rdn );
- rc = ldap_str2rdn( dn, &tmpRDN, &p, LDAP_DN_FORMAT_LDAP );
+ if( dn->bv_len == 0 ) {
+ return LDAP_OTHER;
+ }
+
+ rc = ldap_str2rdn( dn->bv_val, &tmpRDN, &p, LDAP_DN_FORMAT_LDAP );
if ( rc != LDAP_SUCCESS ) {
return rc;
}
Backend *be,
const char *dn_in )
{
+ struct berval bv;
struct berval *rdn = NULL;
int retval = 0;
return 0;
}
- if ( dnExtractRdn( dn_in, &rdn ) != LDAP_SUCCESS ) {
+ bv.bv_val = (char *) dn_in;
+ bv.bv_len = strlen( bv.bv_val );
+
+ if ( dnExtractRdn( &bv, &rdn ) != LDAP_SUCCESS ) {
ber_bvfree( rdn );
return 0;
}
Backend *be,
const char *dn_in )
{
+ struct berval bv;
struct berval *rdn = NULL;
char *retval;
return NULL;
}
- if ( dnExtractRdn( dn_in, &rdn ) != LDAP_SUCCESS ) {
+ bv.bv_val = (char *) dn_in;
+ bv.bv_len = strlen( bv.bv_val );
+
+ if ( dnExtractRdn( &bv, &rdn ) != LDAP_SUCCESS ) {
ber_bvfree( rdn );
return NULL;
}
const struct berval *dn, const struct berval *suffix ));
LDAP_SLAPD_F (int) dnExtractRdn LDAP_P((
- const char *dn, struct berval **rdn ));
+ struct berval *dn, struct berval **rdn ));
LDAP_SLAPD_F (int) rdnValidate LDAP_P(( struct berval * rdn ));