{
Attribute *a = ch_malloc( sizeof( Attribute ) );
#ifdef SLAPD_SCHEMA_NOT_COMPAT
- a->a_desc = slap_schema.si_ad_subschemaSubentry;
+ a->a_desc = ad_dup( slap_schema.si_ad_subschemaSubentry );
#else
a->a_type = ch_strdup("subschemasubentry");
a->a_syntax = SYNTAX_DN | SYNTAX_CIS;
/* Should be backend specific */
a->a_vals = ch_malloc( 2 * sizeof( struct berval * ) );
- a->a_vals[0] = ch_malloc( sizeof( struct berval ) );
- a->a_vals[0]->bv_val = ch_strdup( SLAPD_SCHEMA_DN );
- a->a_vals[0]->bv_len = sizeof( SLAPD_SCHEMA_DN ) - 1;
+ a->a_vals[0] = ber_bvstrdup( SLAPD_SCHEMA_DN );
a->a_vals[1] = NULL;
a->a_next = NULL;
if( op->o_tag == LDAP_REQ_ADD ) {
mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
mod->sml_op = mop;
- mod->sml_desc = slap_schema.si_ad_creatorsName;
+ mod->sml_desc = ad_dup( slap_schema.si_ad_creatorsName );
mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
mod->sml_bvalues[0] = ber_bvdup( &name );
mod->sml_bvalues[1] = NULL;
mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ) );
mod->sml_op = mop;
- mod->sml_desc = slap_schema.si_ad_createTimestamp;
+ mod->sml_desc = ad_dup( slap_schema.si_ad_createTimestamp );
mod->sml_bvalues = (struct berval **) malloc( 2 * sizeof( struct berval * ) );
mod->sml_bvalues[0] = ber_bvdup( ×tamp );
mod->sml_bvalues[1] = NULL;
unsigned i, j;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
- AttributeDescription *ref = slap_schema.si_ad_ref;
+ AttributeDescription *ad_ref = slap_schema.si_ad_ref;
#else
- static const char *ref = "ref";
+ static const char *ad_ref = "ref";
#endif
- attr = attr_find( e->e_attrs, ref );
+ attr = attr_find( e->e_attrs, ad_ref );
if( attr == NULL ) return NULL;
int opattrs;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
- AttributeDescription *entry = slap_schema.si_ad_entry;
+ AttributeDescription *ad_entry = slap_schema.si_ad_entry;
#else
- static const char *entry = "entry";
+ static const char *ad_entry = "entry";
#endif
Debug( LDAP_DEBUG_TRACE, "=> send_search_entry: \"%s\"\n", e->e_dn, 0, 0 );
if ( ! access_allowed( be, conn, op, e,
- entry, NULL, ACL_READ ) )
+ ad_entry, NULL, ACL_READ ) )
{
Debug( LDAP_DEBUG_ACL, "acl: access to entry not allowed\n",
0, 0, 0 );
int bytes;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
- AttributeDescription *ref = slap_schema.si_ad_ref;
- AttributeDescription *entry = slap_schema.si_ad_entry;
+ AttributeDescription *ad_ref = slap_schema.si_ad_ref;
+ AttributeDescription *ad_entry = slap_schema.si_ad_entry;
#else
- static const char *ref = "ref";
- static const char *entry = "entry";
+ static const char *ad_ref = "ref";
+ static const char *ad_entry = "entry";
#endif
Debug( LDAP_DEBUG_TRACE, "=> send_search_reference (%s)\n", e->e_dn, 0, 0 );
if ( ! access_allowed( be, conn, op, e,
- entry, NULL, ACL_READ ) )
+ ad_entry, NULL, ACL_READ ) )
{
Debug( LDAP_DEBUG_ACL,
"send_search_reference: access to entry not allowed\n",
}
if ( ! access_allowed( be, conn, op, e,
- ref, NULL, ACL_READ ) )
+ ad_ref, NULL, ACL_READ ) )
{
Debug( LDAP_DEBUG_ACL,
"send_search_reference: access to reference not allowed\n",