#define TMP_AVA_SLOTS 8
#define TMP_RDN_SLOTS 32
+int
+ldap_bv2dn( struct berval *bv, LDAPDN **dn, unsigned flags )
+{
+ assert( bv );
+ assert( dn );
+
+ /*
+ * FIXME: ldap_bv2dn() and ldap_str2dn() will be swapped,
+ * i.e. ldap_str2dn() will become a wrapper for ldap_bv2dn()
+ */
+ if ( bv->bv_len != strlen( bv->bv_val ) ) {
+ return LDAP_INVALID_DN_SYNTAX;
+ }
+
+ return ldap_str2dn( bv->bv_val, dn, flags );
+}
+
int
ldap_str2dn( LDAP_CONST char *str, LDAPDN **dn, unsigned flags )
{
return( LDAP_SUCCESS );
}
- /* FIXME: str2dn should take a bv and handle this */
- if( strlen( in->bv_val ) != in->bv_len ) {
- return LDAP_INVALID_SYNTAX;
- }
-
- rc = ldap_str2dn( in->bv_val, &dn, LDAP_DN_FORMAT_LDAP );
+ rc = ldap_bv2dn( in, &dn, LDAP_DN_FORMAT_LDAP );
/*
* Schema-aware validate
/*
* Go to structural representation
*/
- rc = ldap_str2dn( val->bv_val, &dn, LDAP_DN_FORMAT_LDAP );
+ rc = ldap_bv2dn( val, &dn, LDAP_DN_FORMAT_LDAP );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
}
LDAPDN *dn = NULL;
int rc;
- /* FIXME: str2dn should take a bv and handle this */
- if( strlen( val->bv_val ) != val->bv_len ) {
- return LDAP_INVALID_SYNTAX;
- }
-
/* FIXME: should be liberal in what we accept */
- rc = ldap_str2dn( val->bv_val, &dn, LDAP_DN_FORMAT_LDAP );
+ rc = ldap_bv2dn( val, &dn, LDAP_DN_FORMAT_LDAP );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
}
}
/* FIXME: should be liberal in what we accept */
- rc = ldap_str2dn( val->bv_val, &dn, LDAP_DN_FORMAT_LDAP );
+ rc = ldap_bv2dn( val, &dn, LDAP_DN_FORMAT_LDAP );
if ( rc != LDAP_SUCCESS ) {
return LDAP_INVALID_SYNTAX;
}