string_expand(&bv, &b->a_dn_pat,
e->e_ndn, matches);
- if ( dnNormalize2(NULL, &bv, &pat, op->o_tmpmemctx ) != LDAP_SUCCESS ) {
+ if ( dnNormalize(0, NULL, NULL, &bv, &pat, op->o_tmpmemctx ) != LDAP_SUCCESS ) {
/* did not expand to a valid dn */
continue;
}
bv.bv_val = buf;
string_expand( &bv, &b->a_group_pat, e->e_ndn, matches );
- if ( dnNormalize2( NULL, &bv, &ndn, op->o_tmpmemctx ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &bv, &ndn, op->o_tmpmemctx ) != LDAP_SUCCESS ) {
/* did not expand to a valid dn */
continue;
}
* also return the syntax or some "comparison cookie".
*/
- if (dnNormalize2(NULL, name, &ndn, cp->op->o_tmpmemctx) == LDAP_SUCCESS) {
+ if (dnNormalize(0, NULL, NULL, name, &ndn, cp->op->o_tmpmemctx) == LDAP_SUCCESS) {
const char *text;
AttributeDescription *desc = NULL;
if (slap_bv2ad(attr, &desc, &text) == LDAP_SUCCESS) {
if ( setat.bv_val != NULL ) {
/*
- * NOTE: dnNormalize2 honors the ber_len field
+ * NOTE: dnNormalize honors the ber_len field
* as the length of the dn to be normalized
*/
- if ( dnNormalize2(NULL, &subjdn, &ndn, op->o_tmpmemctx) == LDAP_SUCCESS
+ if ( dnNormalize(0, NULL, NULL, &subjdn, &ndn, op->o_tmpmemctx) == LDAP_SUCCESS
&& slap_bv2ad(&setat, &desc, &text) == LDAP_SUCCESS )
{
backend_attribute(op, e,
bv.bv_len = sizeof( buf ) - 1;
bv.bv_val = (char *)&buf;
string_expand(&bv, &subjdn, e->e_ndn, matches);
- if ( dnNormalize2(NULL, &bv, &ndn, op->o_tmpmemctx) == LDAP_SUCCESS ) {
+ if ( dnNormalize(0, NULL, NULL, &bv, &ndn, op->o_tmpmemctx) == LDAP_SUCCESS ) {
rc = (backend_group(op, e, &ndn, &op->o_ndn,
grp_oc, grp_ad) == 0);
free( ndn.bv_val );
if (ber_bvstrcasecmp( &aci_bv_access_id, &bv ) == 0) {
struct berval ndn;
rc = 0;
- if ( dnNormalize2(NULL, &sdn, &ndn, op->o_tmpmemctx) == LDAP_SUCCESS ) {
+ if ( dnNormalize(0, NULL, NULL, &sdn, &ndn, op->o_tmpmemctx) == LDAP_SUCCESS ) {
if (dn_match( &op->o_ndn, &ndn))
rc = 1;
free(ndn.bv_val);
{
if ( a->acl_dn_style != ACL_STYLE_REGEX ) {
struct berval bv;
- rc = dnNormalize2( NULL, &a->acl_dn_pat, &bv, NULL);
+ rc = dnNormalize( 0, NULL, NULL, &a->acl_dn_pat, &bv, NULL);
if ( rc != LDAP_SUCCESS ) {
fprintf( stderr,
"%s: line %d: bad DN \"%s\"\n",
}
if ( sty != ACL_STYLE_REGEX && expand == 0 ) {
- rc = dnNormalize2(NULL, &bv, &b->a_dn_pat, NULL);
+ rc = dnNormalize(0, NULL, NULL, &bv, &b->a_dn_pat, NULL);
if ( rc != LDAP_SUCCESS ) {
fprintf( stderr,
"%s: line %d: bad DN \"%s\"\n",
b->a_group_pat = bv;
} else {
ber_str2bv( right, 0, 0, &bv );
- rc = dnNormalize2( NULL, &bv, &b->a_group_pat, NULL );
+ rc = dnNormalize( 0, NULL, NULL, &bv, &b->a_group_pat, NULL );
if ( rc != LDAP_SUCCESS ) {
fprintf( stderr,
"%s: line %d: bad DN \"%s\"\n",
if (!new_ndn.bv_val) {
struct berval bv = {0, NULL};
- dnNormalize2( NULL, &new_dn, &bv, op->o_tmpmemctx );
+ dnNormalize( 0, NULL, NULL, &new_dn, &bv, op->o_tmpmemctx );
ber_dupbv( &new_ndn, &bv );
}
goto done;
}
- rc = dnNormalize2( NULL, &dn, &ndn, op->o_tmpmemctx );
+ rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
rs->sr_text = "Invalid DN";
goto done;
bv.bv_val = refdn;
bv.bv_len = strlen( refdn );
- rc = dnNormalize2( NULL, &bv, &nrefdn, op->o_tmpmemctx );
+ rc = dnNormalize( 0, NULL, NULL, &bv, &nrefdn, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
send_ldap_error( op, rs, LDAP_OTHER,
"DNS SRV problem processing manageDSAit control" );
* from the one known to the meta, and a DN with unknown
* attributes is returned.
*
- * FIXME: should we log anything, or delegate to dnNormalize2?
+ * FIXME: should we log anything, or delegate to dnNormalize?
*/
- if ( dnNormalize2( NULL, &ent->e_name, &ent->e_nname, op->o_tmpmemctx ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &ent->e_name, &ent->e_nname,
+ op->o_tmpmemctx ) != LDAP_SUCCESS )
+ {
return LDAP_INVALID_DN_SYNTAX;
}
/* Build target dn and make sure target entry doesn't exist already. */
build_new_dn( &new_dn, new_parent_dn, &op->oq_modrdn.rs_newrdn );
- dnNormalize2( NULL, &new_dn, &new_ndn, NULL );
+ dnNormalize( 0, NULL, NULL, &new_dn, &new_ndn, NULL );
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_back_modrdn: new ndn=%s\n",
goto done;
}
- rc = dnNormalize2( NULL, &dn, &ndn, op->o_tmpmemctx );
+ rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) {
rs->sr_text = "Invalid DN";
goto done;
if (scope_stored < scope_incoming)
return 0;
- dnNormalize2(NULL, dn_incoming, &ndn_incoming);
- dnNormalize2(NULL, dn_stored, &ndn_stored);
+ dnNormalize(0, NULL, NULL, dn_incoming, &ndn_incoming);
+ dnNormalize(0, NULL, NULL, dn_stored, &ndn_stored);
i = dnIsSuffix(&ndn_incoming, &ndn_stored);
* from the one known to the meta, and a DN with unknown
* attributes is returned.
*
- * FIXME: should we log anything, or delegate to dnNormalize2?
+ * FIXME: should we log anything, or delegate to dnNormalize?
*/
- dnNormalize2( NULL, &ent->e_name, &ent->e_nname );
+ dnNormalize( 0, NULL, NULL, &ent->e_name, &ent->e_nname );
/*
- if ( dnNormalize2( NULL, &ent->e_name, &ent->e_nname ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &ent->e_name, &ent->e_nname )
+ != LDAP_SUCCESS )
+ {
return LDAP_INVALID_DN_SYNTAX;
}
*/
dn.bv_val = argv[ 1 ];
dn.bv_len = strlen( argv[ 1 ] );
- if ( dnNormalize2( NULL, &dn, &li->targets[ i ]->binddn, NULL ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &dn, &li->targets[ i ]->binddn,
+ NULL ) != LDAP_SUCCESS )
+ {
fprintf( stderr, "%s: line %d: "
"bind DN '%s' is invalid\n",
fname, lineno, argv[ 1 ] );
dn.bv_val = argv[ 1 ];
dn.bv_len = strlen( argv[ 1 ] );
- if ( dnNormalize2( NULL, &dn, &li->targets[ i ]->pseudorootdn, NULL ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &dn,
+ &li->targets[ i ]->pseudorootdn, NULL ) != LDAP_SUCCESS )
+ {
fprintf( stderr, "%s: line %d: "
"pseudoroot DN '%s' is invalid\n",
fname, lineno, argv[ 1 ] );
* from the one known to the meta, and a DN with unknown
* attributes is returned.
*
- * FIXME: should we log anything, or delegate to dnNormalize2?
+ * FIXME: should we log anything, or delegate to dnNormalize?
*/
- if ( dnNormalize2( NULL, &ent.e_name, &ent.e_nname, &op->o_tmpmemctx ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &ent.e_name, &ent.e_nname,
+ &op->o_tmpmemctx ) != LDAP_SUCCESS )
+ {
return LDAP_INVALID_DN_SYNTAX;
}
dn.bv_val = SLAPD_MONITOR_DN;
dn.bv_len = sizeof( SLAPD_MONITOR_DN ) - 1;
- rc = dnNormalize2( NULL, &dn, &ndn, NULL );
+ rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, NULL );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, CRIT,
sprintf( vals[0].bv_val, "uid=%s,%s",
pw->pw_name, be->be_suffix[0].bv_val );
- rc = dnNormalize2( NULL, vals, &bv );
+ rc = dnNormalize( 0, NULL, NULL, vals, &bv );
if( rc != LDAP_SUCCESS ) {
free( vals[0].bv_val );
return NULL;
}
build_new_dn( &new_dn, new_pdn, &op->oq_modrdn.rs_newrdn );
- rs->sr_err = dnNormalize2( NULL, &new_dn, &new_ndn, op->o_tmpmemctx );
+ rs->sr_err = dnNormalize( 0, NULL, NULL, &new_dn, &new_ndn,
+ op->o_tmpmemctx );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, "backsql_modrdn(): "
"new dn is invalid ('%s') - aborting\n",
dn.bv_val = cargv[1];
dn.bv_len = strlen( cargv[1] );
- rc = dnNormalize2( NULL, &dn, &be->be_update_ndn, NULL );
+ rc = dnNormalize( 0, NULL, NULL, &dn, &be->be_update_ndn, NULL );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, CRIT,
if ( !global_schemadn.bv_val ) {
ber_str2bv( SLAPD_SCHEMA_DN, sizeof(SLAPD_SCHEMA_DN)-1, 1,
&global_schemadn );
- dnNormalize2( NULL, &global_schemadn, &global_schemandn, NULL );
+ dnNormalize( 0, NULL, NULL, &global_schemadn, &global_schemandn, NULL );
}
if ( load_ucdata( NULL ) < 0 ) return 1;
bv.bv_val = (char *) pattern;
bv.bv_len = strlen( pattern );
- rc = dnNormalize2( NULL, &bv, &lm->lm_dn_pat, NULL );
+ rc = dnNormalize( 0, NULL, NULL, &bv, &lm->lm_dn_pat, NULL );
if ( rc != LDAP_SUCCESS ) {
ch_free( lm );
return( -1 );
struct berval *val ));
LDAP_SLAPD_F (slap_mr_normalize_func) dnNormalize;
-#define dnNormalize2(s,v,n,x) dnNormalize(0,(s),NULL,(v),(n),(x))
LDAP_SLAPD_F (slap_syntax_transform_func) dnPretty;
dn.bv_val = (char *) suffix;
dn.bv_len = strlen( dn.bv_val );
- rc = dnNormalize2( NULL, &dn, &ndn, NULL );
+ rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, NULL );
if( rc != LDAP_SUCCESS ) {
return 2;
}
/* All strings are in DN form now. Normalize if needed. */
if ( do_norm ) {
- rc = dnNormalize2( NULL, dn, &dn2, op->o_tmpmemctx );
+ rc = dnNormalize( 0, NULL, NULL, dn, &dn2, op->o_tmpmemctx );
/* User DNs were constructed above and must be freed now */
sl_free( dn->bv_val, op->o_tmpmemctx );
is_dn: bv.bv_len = uri->bv_len - (bv.bv_val - uri->bv_val);
- rc = dnNormalize2( NULL, &bv, searchbase, op->o_tmpmemctx );
+ rc = dnNormalize( 0, NULL, NULL, &bv, searchbase, op->o_tmpmemctx );
if( rc == LDAP_SUCCESS ) {
*scope = LDAP_SCOPE_BASE;
}
/* Grab the searchbase */
bv.bv_val = ludp->lud_dn;
bv.bv_len = strlen( bv.bv_val );
- rc = dnNormalize2( NULL, &bv, searchbase, op->o_tmpmemctx );
+ rc = dnNormalize( 0, NULL, NULL, &bv, searchbase, op->o_tmpmemctx );
done:
if( rc != LDAP_SUCCESS ) {
*(uid.bv_val++) = '\0';
}
- rc = dnNormalize2( NULL, &out, normalized, ctx );
+ rc = dnNormalize( 0, NULL, NULL, &out, normalized, ctx );
if( rc != LDAP_SUCCESS ) {
free( out.bv_val );
bv.bv_len = end-begin+1;
bv.bv_val = begin;
- dnNormalize2( NULL, &bv, issuer_dn );
+ return dnNormalize( 0, NULL, NULL, &bv, issuer_dn );
}
return LDAP_SUCCESS;
if( op->o_req_ndn.bv_val != NULL) {
sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
}
- rc = dnNormalize2( NULL, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
+ rc = dnNormalize( 0, NULL, NULL, &op->o_req_dn, &op->o_req_ndn,
+ op->o_tmpmemctx );
if ( rc != LDAP_SUCCESS ) {
return rc;
}
bdn.bv_val = dn;
bdn.bv_len = strlen( dn );
- if ( dnNormalize2( NULL, &bdn, &ndn, NULL ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &bdn, &ndn, NULL ) != LDAP_SUCCESS ) {
return NULL;
}
bsuffix.bv_val = suffix;
bsuffix.bv_len = strlen( suffix );
- if ( dnNormalize2( NULL, &bdn, &ndn, NULL ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &bdn, &ndn, NULL ) != LDAP_SUCCESS ) {
return 0;
}
- if ( dnNormalize2( NULL, &bsuffix, &nsuffix, NULL ) != LDAP_SUCCESS ) {
+ if ( dnNormalize( 0, NULL, NULL, &bsuffix, &nsuffix, NULL )
+ != LDAP_SUCCESS )
+ {
slapi_ch_free( (void **)&ndn.bv_val );
return 0;
}
if( base.bv_val != NULL ) {
struct berval nbase;
- rc = dnNormalize2( NULL, &base, &nbase, NULL );
+ rc = dnNormalize( 0, NULL, NULL, &base, &nbase, NULL );
if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: slap_init invalid suffix (\"%s\")\n",
progname, base.bv_val );