/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1999-2005 The OpenLDAP Foundation.
+ * Copyright 1999-2007 The OpenLDAP Foundation.
* Portions Copyright 1999 Dmitry Kovalev.
* Portions Copyright 2002 Pierangelo Masarati.
* All rights reserved.
return NULL;
}
- a = ch_malloc( sizeof( Attribute ) );
- a->a_desc = desc;
+ a = attr_alloc( desc );
a->a_vals = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
a->a_vals[ 0 ] = val;
a->a_nvals = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
a->a_nvals[ 0 ] = nval;
BER_BVZERO( &a->a_nvals[ 1 ] );
-
- a->a_next = NULL;
- a->a_flags = 0;
return a;
}
struct berval entryCSN;
Attribute *a;
- a = ch_malloc( sizeof( Attribute ) );
- a->a_desc = slap_schema.si_ad_entryCSN;
+ a = attr_alloc( slap_schema.si_ad_entryCSN );
a->a_vals = ch_malloc( 2 * sizeof( struct berval ) );
BER_BVZERO( &a->a_vals[ 1 ] );
#ifdef BACKSQL_SYNCPROV
- if ( op->o_sync && op->o_tag == LDAP_REQ_SEARCH ) {
+ if ( op->o_sync && op->o_tag == LDAP_REQ_SEARCH && op->o_private != NULL ) {
assert( op->o_private != NULL );
entryCSN = *((struct berval *)op->o_private);
} else
#endif /* BACKSQL_SYNCPROV */
{
- slap_get_csn( op, csnbuf, sizeof(csnbuf), &entryCSN, 0 );
+ entryCSN.bv_val = csnbuf;
+ entryCSN.bv_len = sizeof( csnbuf );
+ slap_get_csn( op, &entryCSN, 0 );
}
ber_dupbv( &a->a_vals[ 0 ], &entryCSN );
a->a_nvals = a->a_vals;
- a->a_next = NULL;
- a->a_flags = 0;
-
return a;
}