/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1999-2007 The OpenLDAP Foundation.
+ * Copyright 1999-2009 The OpenLDAP Foundation.
* Portions Copyright 1999 Dmitry Kovalev.
* Portions Copyright 2002 Pierangelo Masarati.
* Portions Copyright 2004 Mark Adamson.
dst->eid_keyval = src->eid_keyval;
#endif /* ! BACKSQL_ARBITRARY_KEY */
+ dst->eid_oc = src->eid_oc;
dst->eid_oc_id = src->eid_oc_id;
return dst;
BerVarray tmp;
if ( attr->a_vals != NULL ) {
- for ( ; !BER_BVISNULL( &attr->a_vals[ oldcount ] ); oldcount++ )
- /* just count */ ;
+ oldcount = attr->a_numvals;
}
tmp = ch_realloc( attr->a_vals, ( oldcount + count + 1 ) * sizeof( struct berval ) );
} else {
attr->a_nvals = attr->a_vals;
}
+ attr->a_numvals += count;
} else {
append = 1;
/* Make space for the array of values */
attr = attr_alloc( at->bam_true_ad );
+ attr->a_numvals = count;
attr->a_vals = ch_calloc( count + 1, sizeof( struct berval ) );
if ( attr->a_vals == NULL ) {
Debug( LDAP_DEBUG_TRACE, "Out of memory!\n", 0,0,0 );
ch_free( attr );
return 1;
}
- memset( attr->a_vals, 0, ( count + 1 ) * sizeof( struct berval ) );
if ( normfunc ) {
attr->a_nvals = ch_calloc( count + 1, sizeof( struct berval ) );
if ( attr->a_nvals == NULL ) {
ch_free( attr );
return 1;
- } else {
- memset( attr->a_nvals, 0, ( count + 1 ) * sizeof( struct berval ) );
}
} else {
bsi->bsi_e->e_attrs = NULL;
bsi->bsi_e->e_private = NULL;
- bsi->bsi_oc = backsql_id2oc( bsi->bsi_op->o_bd->be_private,
+ if ( eid->eid_oc == NULL ) {
+ eid->eid_oc = backsql_id2oc( bsi->bsi_op->o_bd->be_private,
eid->eid_oc_id );
+ }
+ bsi->bsi_oc = eid->eid_oc;
bsi->bsi_c_eid = eid;
#ifndef BACKSQL_ARBITRARY_KEY
}
if ( ( bsi->bsi_flags & BSQL_SF_ALL_OPER )
- || an_find( bsi->bsi_attrs, &AllOper )
+ || an_find( bsi->bsi_attrs, slap_bv_all_operational_attrs )
|| an_find( bsi->bsi_attrs, &slap_schema.si_ad_structuralObjectClass->ad_cname ) )
{
ObjectClass *soc = NULL;