e.e_attrs = NULL;
e.e_private = NULL;
- attr_mergeit_one( &e, ad_objectClass, &slap_schema.si_oc_referral->soc_cname );
- attr_mergeit_one( &e, ad_objectClass, &slap_schema.si_oc_extensibleObject->soc_cname );
+ attr_merge_one( &e, ad_objectClass, &slap_schema.si_oc_referral->soc_cname, NULL );
+ attr_merge_one( &e, ad_objectClass, &slap_schema.si_oc_extensibleObject->soc_cname, NULL );
if ( ad_dc ) {
char *p;
bv.bv_len = strlen( bv.bv_val );
}
- attr_mergeit_one( &e, ad_dc, &bv );
+ attr_merge_normalize_one( &e, ad_dc, &bv, NULL );
}
if ( ad_associatedDomain ) {
struct berval bv;
ber_str2bv( domain, 0, 0, &bv );
- attr_mergeit_one( &e, ad_associatedDomain, &bv );
+ attr_merge_normalize_one( &e, ad_associatedDomain, &bv, NULL );
}
- attr_mergeit( &e, ad_ref, urls );
+ attr_merge_normalize_one( &e, ad_ref, urls, NULL );
rc = test_filter( op, &e, op->oq_search.rs_filter );
goto done;
}
- attr_mergeit_one( &e, desc, &rdn[0]->la_value );
+ attr_merge_normalize_one( &e, desc, &rdn[0]->la_value, NULL );
ldap_rdnfree(rdn);
rdn = NULL;
* should be a configuratable item
*/
BER_BVSTR( &val, "organizationalUnit" );
- attr_mergeit_one( &e, ad_objectClass, &val );
+ attr_merge_one( &e, ad_objectClass, &val, NULL );
if ( test_filter( op, &e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
rs->sr_entry = &e;
e->e_attrs = NULL;
/* objectclasses should be configurable items */
-#if 0
- /* "top" is redundant */
- BER_BVSTR( &val, "top" );
- attr_mergeit_one( e, ad_objectClass, &val );
-#endif
-
BER_BVSTR( &val, "person" );
- attr_mergeit_one( e, slap_schema.si_ad_objectClass, &val );
+ attr_merge_one( e, slap_schema.si_ad_objectClass, &val, NULL );
BER_BVSTR( &val, "uidObject" );
- attr_mergeit_one( e, slap_schema.si_ad_objectClass, &val );
+ attr_merge_one( e, slap_schema.si_ad_objectClass, &val, NULL );
val.bv_val = pw->pw_name;
val.bv_len = pwlen;
- attr_mergeit_one( e, slap_schema.si_ad_uid, &val ); /* required by uidObject */
- attr_mergeit_one( e, slap_schema.si_ad_cn, &val ); /* required by person */
- attr_mergeit_one( e, ad_sn, &val ); /* required by person */
+ attr_merge_normalize_one( e, slap_schema.si_ad_uid, &val, NULL ); /* required by uidObject */
+ attr_merge_normalize_one( e, slap_schema.si_ad_cn, &val, NULL ); /* required by person */
+ attr_merge_normalize_one( e, ad_sn, &val, NULL ); /* required by person */
#ifdef HAVE_PW_GECOS
/*
char *s;
ber_str2bv( pw->pw_gecos, 0, 0, &val );
- attr_mergeit_one( e, ad_desc, &val );
+ attr_merge_normalize_one( e, ad_desc, &val, NULL );
s = strchr( val.bv_val, ',' );
if ( s ) *s = '\0';
val.bv_len = strlen( val.bv_val );
if ( val.bv_len && strcasecmp( val.bv_val, pw->pw_name ) ) {
- attr_mergeit_one( e, slap_schema.si_ad_cn, &val );
+ attr_merge_normalize_one( e, slap_schema.si_ad_cn, &val, NULL );
}
if ( ( s = strrchr(val.bv_val, ' ' ) ) ) {
ber_str2bv( s + 1, 0, 0, &val );
- attr_mergeit_one( e, ad_sn, &val );
+ attr_merge_normalize_one( e, ad_sn, &val, NULL );
}
}
#endif /* HAVE_PW_GECOS */
static int
config_referral(ConfigArgs *c) {
- struct berval vals[2];
+ struct berval val;
if (c->op == SLAP_CONFIG_EMIT) {
if ( default_referral ) {
value_add( &c->rvalue_vals, default_referral );
return(1);
}
- ber_str2bv(c->argv[1], 0, 0, &vals[0]);
- vals[1].bv_val = NULL; vals[1].bv_len = 0;
- if(value_add(&default_referral, vals)) return(LDAP_OTHER);
+ ber_str2bv(c->argv[1], 0, 0, &val);
+ if(value_add_one(&default_referral, &val)) return(LDAP_OTHER);
return(0);
}
static int
config_updateref(ConfigArgs *c) {
- struct berval vals[2];
+ struct berval val;
if (c->op == SLAP_CONFIG_EMIT) {
if ( c->be->be_update_refs ) {
value_add( &c->rvalue_vals, c->be->be_update_refs );
c->log, c->argv[1], 0);
return(1);
}
- ber_str2bv(c->argv[1], 0, 0, &vals[0]);
- vals[1].bv_val = NULL;
- if(value_add(&c->be->be_update_refs, vals)) return(LDAP_OTHER);
+ ber_str2bv(c->argv[1], 0, 0, &val);
+ if(value_add_one(&c->be->be_update_refs, &val)) return(LDAP_OTHER);
return(0);
}
config_build_entry( ConfigArgs *c, Entry *e, ObjectClass *oc,
struct berval *rdn, ConfigTable *ct, int table )
{
- struct berval vals[2];
+ struct berval val;
struct berval ad_name;
AttributeDescription *ad = NULL;
int rc, i;
AttributeType **at;
Attribute *oc_at;
- BER_BVZERO( &vals[1] );
-
- vals[0] = oc->soc_cname;
- attr_merge_normalize(e, slap_schema.si_ad_objectClass, vals, NULL );
+ val = oc->soc_cname;
+ attr_merge_normalize_one(e, slap_schema.si_ad_objectClass, &val, NULL );
ptr = strchr(rdn->bv_val, '=');
ad_name.bv_val = rdn->bv_val;
ad_name.bv_len = ptr - rdn->bv_val;
if ( rc ) {
return rc;
}
- vals[0].bv_val = ptr+1;
- vals[0].bv_len = rdn->bv_len - (vals[0].bv_val - rdn->bv_val);
- attr_merge_normalize(e, ad, vals, NULL );
+ val.bv_val = ptr+1;
+ val.bv_len = rdn->bv_len - (val.bv_val - rdn->bv_val);
+ attr_merge_normalize_one(e, ad, &val, NULL );
for (at=oc->soc_required; at && *at; at++) {
/* Skip the naming attr */
}
}
oc_at = attr_find( e->e_attrs, slap_schema.si_ad_objectClass );
- rc = structural_class(oc_at->a_vals, vals, NULL, &text, textbuf, textlen);
- BER_BVZERO( &vals[1] );
- attr_merge_normalize(e, slap_schema.si_ad_structuralObjectClass, vals, NULL );
+ rc = structural_class(oc_at->a_vals, &val, NULL, &text, textbuf, textlen);
+ attr_merge_normalize_one(e, slap_schema.si_ad_structuralObjectClass, &val, NULL );
return 0;
}
const char **text )
{
Entry *e;
- struct berval vals[2], *bv;
- struct berval nvals[2];
+ struct berval val, *bv;
+ struct berval nval;
int i, j;
char ** supportedSASLMechanisms;
BackendDB *be;
AttributeDescription *ad_ref
= slap_schema.si_ad_ref;
- vals[1].bv_val = NULL;
- nvals[1].bv_val = NULL;
-
e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) );
if( e == NULL ) {
e->e_private = NULL;
- vals[0].bv_val = "top";
- vals[0].bv_len = sizeof("top")-1;
- if( attr_merge( e, ad_objectClass, vals, NULL ) ) {
+ BER_BVSTR( &val, "top" );
+ if( attr_merge_one( e, ad_objectClass, &val, NULL ) ) {
return LDAP_OTHER;
}
- vals[0].bv_val = "OpenLDAProotDSE";
- vals[0].bv_len = sizeof("OpenLDAProotDSE")-1;
- if( attr_merge( e, ad_objectClass, vals, NULL ) ) {
+ BER_BVSTR( &val, "OpenLDAProotDSE" );
+ if( attr_merge_one( e, ad_objectClass, &val, NULL ) ) {
return LDAP_OTHER;
}
- if( attr_merge( e, ad_structuralObjectClass, vals, NULL ) ) {
+ if( attr_merge_one( e, ad_structuralObjectClass, &val, NULL ) ) {
return LDAP_OTHER;
}
continue;
}
if ( SLAP_MONITOR( be )) {
- vals[0] = be->be_suffix[0];
- nvals[0] = be->be_nsuffix[0];
- if( attr_merge( e, ad_monitorContext, vals, nvals ) ) {
+ if( attr_merge_one( e, ad_monitorContext,
+ &be->be_suffix[0],
+ &be->be_nsuffix[0] ) )
+ {
return LDAP_OTHER;
}
continue;
}
if ( SLAP_CONFIG( be )) {
- vals[0] = be->be_suffix[0];
- nvals[0] = be->be_nsuffix[0];
- if( attr_merge( e, ad_configContext, vals, nvals ) ) {
+ if( attr_merge_one( e, ad_configContext,
+ &be->be_suffix[0],
+ & be->be_nsuffix[0] ) )
+ {
return LDAP_OTHER;
}
continue;
continue;
}
for ( j = 0; be->be_suffix[j].bv_val != NULL; j++ ) {
- vals[0] = be->be_suffix[j];
- nvals[0] = be->be_nsuffix[0];
- if( attr_merge( e, ad_namingContexts, vals, nvals ) ) {
+ if( attr_merge_one( e, ad_namingContexts,
+ &be->be_suffix[j],
+ &be->be_nsuffix[0] ) )
+ {
return LDAP_OTHER;
}
}
#ifdef LDAP_SLAPI
/* netscape supportedExtension */
for ( i = 0; (bv = slapi_int_get_supported_extop(i)) != NULL; i++ ) {
- vals[0] = *bv;
- if( attr_merge( e, ad_supportedExtension, vals, NULL )) {
+ if( attr_merge_one( e, ad_supportedExtension, bv, NULL ) ) {
return LDAP_OTHER;
}
}
continue;
}
snprintf(buf, sizeof buf, "%d", i);
- vals[0].bv_val = buf;
- vals[0].bv_len = strlen( vals[0].bv_val );
- if( attr_merge( e, ad_supportedLDAPVersion, vals, NULL ) ) {
+ val.bv_val = buf;
+ val.bv_len = strlen( val.bv_val );
+ if( attr_merge( e, ad_supportedLDAPVersion, &val, NULL ) ) {
return LDAP_OTHER;
}
}
if( supportedSASLMechanisms != NULL ) {
for ( i=0; supportedSASLMechanisms[i] != NULL; i++ ) {
- vals[0].bv_val = supportedSASLMechanisms[i];
- vals[0].bv_len = strlen( vals[0].bv_val );
- if( attr_merge( e, ad_supportedSASLMechanisms, vals, NULL ) ) {
+ val.bv_val = supportedSASLMechanisms[i];
+ val.bv_len = strlen( val.bv_val );
+ if( attr_merge( e, ad_supportedSASLMechanisms, &val, NULL ) ) {
return LDAP_OTHER;
}
}
}
if( sc == NULL ) {
- struct berval vals[2];
+ struct berval val;
- rc = structural_class( oc->a_vals, vals,
+ rc = structural_class( oc->a_vals, &val,
NULL, &text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
break;
}
- vals[1].bv_len = 0;
- vals[1].bv_val = NULL;
-
- attr_merge( e, slap_schema.si_ad_structuralObjectClass,
- vals, NULL /* FIXME */ );
+ attr_merge_one( e, slap_schema.si_ad_structuralObjectClass, &val, NULL );
}
/* check schema */
{
vals[0].bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ) );
vals[0].bv_val = uuidbuf;
- attr_merge_normalize_one( e,
- slap_schema.si_ad_entryUUID, vals, NULL );
+ attr_merge_normalize_one( e, slap_schema.si_ad_entryUUID, vals, NULL );
}
if( attr_find( e->e_attrs, slap_schema.si_ad_creatorsName )