liblber:ber_bvarray_{add,free}.
char *bv_val;
} BerValue;
-typedef BerValue *BVarray; /* To distinguish from a single bv */
+typedef BerValue *BerVarray; /* To distinguish from a single bv */
/* this should be moved to lber-int.h */
ber_strdup LDAP_P((
LDAP_CONST char * ));
+LBER_F( void )
+ber_bvarray_free LDAP_P(( BerVarray p ));
+
+LBER_F( int )
+ber_bvarray_add LDAP_P(( BerVarray *p, BerValue *bv ));
+
/*
* error.c
*/
ber_len_t off;
union {
char ***c;
- BVarray *ba;
+ BerVarray *ba;
struct berval ***bv;
} res;
} bgbvr;
*bvp = bv;
break;
case BvOff:
- *(BVarray)((long)(*b->res.ba)+n*b->siz+b->off) = bv;
+ *(BerVarray)((long)(*b->res.ba)+n*b->siz+b->off) = bv;
}
} else {
/* Failure will propagate up and free in reverse
case 'v': /* sequence of strings */
case 'V': /* sequence of strings + lengths */
- case 'W': /* BVarray */
+ case 'W': /* BerVarray */
case 'm': /* berval in-place */
case 'M': /* BVoff array in-place */
case 'n': /* null */
}
break;
- case 'W': /* BVarray */
- if ( (bv = va_arg( ap, BVarray )) == NULL )
+ case 'W': /* BerVarray */
+ if ( (bv = va_arg( ap, BerVarray )) == NULL )
break;
for ( i = 0; bv[i].bv_val != NULL; i++ ) {
if ( (rc = ber_put_berval( ber, &bv[i],
p[ len ] = '\0';
return p;
}
+
+void
+ber_bvarray_free( BerVarray a )
+{
+ int i;
+
+ ber_int_options.lbo_valid = LBER_INITIALIZED;
+
+ if (a) {
+ BER_MEM_VALID( a );
+
+ for (i=0; a[i].bv_val; i++) {
+ LBER_FREE(a[i].bv_val);
+ }
+
+ LBER_FREE(a);
+ }
+}
+
+int
+ber_bvarray_add( BerVarray *a, BerValue *bv )
+{
+ int n;
+
+ ber_int_options.lbo_valid = LBER_INITIALIZED;
+
+ if ( *a == NULL ) {
+ if (bv == NULL) {
+ return 0;
+ }
+ n = 0;
+ *a = (BerValue *) LBER_MALLOC( 2 * sizeof(BerValue) );
+ } else {
+ BER_MEM_VALID( a );
+
+ for ( n = 0; *a != NULL && (*a)[n].bv_val != NULL; n++ ) {
+ ; /* NULL */
+ }
+
+ if (bv == NULL) {
+ return n;
+ }
+ *a = (BerValue *) LBER_REALLOC( (char *) *a,
+ (n + 2) * sizeof(BerValue) );
+ }
+ if ( *a == NULL ) {
+ return -1;
+ }
+
+ (*a)[n++] = *bv;
+ (*a)[n].bv_val = NULL;
+
+ return n;
+}
Operation *op;
} AciSetCookie;
-BVarray aci_set_gather (void *cookie, char *name, struct berval *attr);
+BerVarray aci_set_gather (void *cookie, char *name, struct berval *attr);
static int aci_match_set ( struct berval *subj, Backend *be,
Entry *e, Connection *conn, Operation *op, int setref );
return(bv->bv_len);
}
-BVarray
+BerVarray
aci_set_gather (void *cookie, char *name, struct berval *attr)
{
AciSetCookie *cp = cookie;
- BVarray bvals = NULL;
+ BerVarray bvals = NULL;
struct berval bv, ndn;
/* this routine needs to return the bervals instead of
} else {
struct berval subjdn, ndn = { 0, NULL };
struct berval setat;
- BVarray bvals;
+ BerVarray bvals;
const char *text;
AttributeDescription *desc = NULL;
bvals[0].bv_val = bvals[i-1].bv_val;
bvals[i-1].bv_val = NULL;
}
- bvarray_free(bvals);
+ ber_bvarray_free(bvals);
}
}
if (ndn.bv_val)
*/
be = select_backend( &e->e_nname, manageDSAit, 0 );
if ( be == NULL ) {
- BVarray ref = referral_rewrite( default_referral,
+ BerVarray ref = referral_rewrite( default_referral,
NULL, &e->e_name, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
- if ( ref ) bvarray_free( ref );
+ if ( ref ) ber_bvarray_free( ref );
goto done;
}
#ifndef SLAPD_MULTIMASTER
} else {
- BVarray defref = be->be_update_refs
+ BerVarray defref = be->be_update_refs
? be->be_update_refs : default_referral;
- BVarray ref = referral_rewrite( defref,
+ BerVarray ref = referral_rewrite( defref,
NULL, &e->e_name, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
ref ? ref : defref, NULL );
- if ( ref ) bvarray_free( ref );
+ if ( ref ) ber_bvarray_free( ref );
#endif
}
} else {
void
attr_free( Attribute *a )
{
- bvarray_free( a->a_vals );
+ ber_bvarray_free( a->a_vals );
free( a );
}
attr_merge(
Entry *e,
AttributeDescription *desc,
- BVarray vals )
+ BerVarray vals )
{
Attribute **a;
if ( p == NULL ) {
char *matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
ch_free( matched_dn );
goto done;
if ( is_entry_referral( p ) ) {
/* parent is a referral, don't allow add */
char *matched_dn = ch_strdup( p->e_dn );
- BVarray refs = is_entry_referral( p )
+ BerVarray refs = is_entry_referral( p )
? get_entry_referrals( be, conn, op, p )
: NULL;
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
free( matched_dn );
goto done;
}
Entry *target,
struct berval *entry_ndn,
AttributeDescription *entry_at,
- BVarray *vals )
+ BerVarray *vals )
{
struct bdbinfo *li = (struct bdbinfo *) be->be_private;
Entry *e;
int i, j, rc;
Attribute *attr;
- BVarray v;
+ BerVarray v;
const char *entry_at_name = entry_at->ad_cname.bv_val;
#ifdef NEW_LOGGING
/* count them */
}
- v = (BVarray) ch_malloc( sizeof(struct berval) * (i+1) );
+ v = (BerVarray) ch_malloc( sizeof(struct berval) * (i+1) );
for ( i=0, j=0; attr->a_vals[i].bv_val != NULL; i++ ) {
if( conn != NULL
/* get entry with reader lock */
if ( e == NULL ) {
char *matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
if( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
NULL, NULL, NULL, NULL );
}
- bvarray_free( refs );
+ ber_bvarray_free( refs );
free( matched_dn );
return rc;
if ( is_entry_referral( e ) ) {
/* entry is a referral, don't allow bind */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
NULL, NULL, NULL, NULL );
}
- bvarray_free( refs );
+ ber_bvarray_free( refs );
goto done;
}
if ( e == NULL ) {
char *matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
free( matched_dn );
goto done;
if (!manageDSAit && is_entry_referral( e ) ) {
/* entry is a referral, don't allow add */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
goto done;
}
if ( e == NULL ) {
char *matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
Debug( LDAP_DEBUG_ARGS,
"<=- bdb_delete: no such object %s\n",
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
free( matched_dn );
rc = -1;
if ( !manageDSAit && is_entry_referral( e ) ) {
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
Debug( LDAP_DEBUG_TRACE,
send_ldap_result( conn, op, LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
rc = 1;
goto done;
struct berval **rspdata,
LDAPControl *** rspctrls,
const char** text,
- BVarray *refs
+ BerVarray *refs
)
{
int i;
break;
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
Debug( LDAP_DEBUG_TRACE,
"<= bdb_equality_candidates id=%ld, first=%ld, last=%ld\n",
break;
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
Debug( LDAP_DEBUG_TRACE, "<= bdb_approx_candidates %ld, first=%ld, last=%ld\n",
(long) ids[0],
break;
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
Debug( LDAP_DEBUG_TRACE, "<= bdb_substring_candidates %ld, first=%ld, last=%ld\n",
(long) ids[0],
DB_TXN *txn,
char *dbname,
struct berval *atname,
- BVarray vals,
+ BerVarray vals,
ID id,
int op,
slap_mask_t mask )
for( i=0; keys[i].bv_val != NULL; i++ ) {
rc = bdb_key_change( be, db, txn, &keys[i], id, op );
if( rc ) {
- bvarray_free( keys );
+ ber_bvarray_free( keys );
goto done;
}
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
}
rc = LDAP_SUCCESS;
}
for( i=0; keys[i].bv_val != NULL; i++ ) {
rc = bdb_key_change( be, db, txn, &keys[i], id, op );
if( rc ) {
- bvarray_free( keys );
+ ber_bvarray_free( keys );
goto done;
}
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
}
rc = LDAP_SUCCESS;
for( i=0; keys[i].bv_val != NULL; i++ ) {
bdb_key_change( be, db, txn, &keys[i], id, op );
if( rc ) {
- bvarray_free( keys );
+ ber_bvarray_free( keys );
goto done;
}
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
}
rc = LDAP_SUCCESS;
DB_TXN *txn,
AttributeType *type,
struct berval *lang,
- BVarray vals,
+ BerVarray vals,
ID id,
int op,
char ** dbnamep,
Backend *be,
DB_TXN *txn,
AttributeDescription *desc,
- BVarray vals,
+ BerVarray vals,
ID id,
int op )
{
/* acquire and lock entry */
if ( e == NULL ) {
char* matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
free( matched_dn );
return rc;
if ( !manageDSAit && is_entry_referral( e ) ) {
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
Debug( LDAP_DEBUG_TRACE,
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
goto done;
}
if ( e == NULL ) {
char* matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
if( matched != NULL ) {
matched_dn = strdup( matched->e_dn );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
free( matched_dn );
goto done;
if (!manageDSAit && is_entry_referral( e ) ) {
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry %s is referral\n",
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
goto done;
}
mod_tmp = ( Modifications * )ch_malloc( sizeof( Modifications )
+ 2 * sizeof( struct berval ) );
mod_tmp->sml_desc = desc;
- mod_tmp->sml_bvalues = ( BVarray )( mod_tmp + 1 );
+ mod_tmp->sml_bvalues = ( BerVarray )( mod_tmp + 1 );
mod_tmp->sml_bvalues[ 0 ] = new_rdn[0][ a_cnt ]->la_value;
mod_tmp->sml_bvalues[ 1 ].bv_val = NULL;
mod_tmp->sml_op = SLAP_MOD_SOFTADD;
mod_tmp = ( Modifications * )ch_malloc( sizeof( Modifications )
+ 2 * sizeof ( struct berval ) );
mod_tmp->sml_desc = desc;
- mod_tmp->sml_bvalues = ( BVarray )(mod_tmp+1);
+ mod_tmp->sml_bvalues = ( BerVarray )(mod_tmp+1);
mod_tmp->sml_bvalues[ 0 ] = old_rdn[0][ d_cnt ]->la_value;
mod_tmp->sml_bvalues[ 1 ].bv_val = NULL;
mod_tmp->sml_op = LDAP_MOD_DELETE;
struct berval **rspdata,
LDAPControl *** rspctrls,
const char **text,
- BVarray *refs )
+ BerVarray *refs )
{
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
int rc;
Backend *be,
DB_TXN *txn,
AttributeDescription *desc,
- BVarray vals,
+ BerVarray vals,
ID id,
int op ));
if ( e == NULL ) {
char *matched_dn = NULL;
- BVarray refs = NULL;
+ BerVarray refs = NULL;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
/* send referrals */
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
} else if ( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc, matched_dn,
matched_dn ? "bad referral object" : NULL,
if ( is_entry_referral( e ) ) {
/* entry is a referral */
- BVarray refs = get_entry_referrals( be, conn, op, e );
- BVarray rrefs = referral_rewrite(
+ BerVarray refs = get_entry_referrals( be, conn, op, e );
+ BerVarray rrefs = referral_rewrite(
refs, &e->e_name, dn, LDAP_SCOPE_DEFAULT );
Debug( LDAP_DEBUG_TRACE,
if( rrefs != NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
e->e_dn, NULL, rrefs, NULL );
- bvarray_free( rrefs );
+ ber_bvarray_free( rrefs );
} else {
send_ldap_result( conn, op, rc = LDAP_OTHER, e->e_dn,
"bad referral object", NULL, NULL );
}
- bvarray_free( refs );
+ ber_bvarray_free( refs );
}
bdb_entry_return( be, e );
ID id, cursor;
ID candidates[BDB_IDL_UM_SIZE];
Entry *e = NULL;
- BVarray v2refs = NULL;
+ BerVarray v2refs = NULL;
Entry *matched = NULL;
struct berval realbase = { 0, NULL };
int nentries = 0;
if ( e == NULL ) {
struct berval matched_dn = { 0, NULL };
- BVarray refs = NULL;
+ BerVarray refs = NULL;
if ( matched != NULL ) {
- BVarray erefs;
+ BerVarray erefs;
ber_dupbv( &matched_dn, &matched->e_name );
if( erefs ) {
refs = referral_rewrite( erefs, &matched_dn,
base, scope );
- bvarray_free( erefs );
+ ber_bvarray_free( erefs );
}
} else {
send_ldap_result( conn, op, rc=LDAP_REFERRAL ,
matched_dn.bv_val, text, refs, NULL );
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
if ( matched_dn.bv_val ) ber_memfree( matched_dn.bv_val );
return rc;
}
if (!manageDSAit && e != &slap_entry_root && is_entry_referral( e ) ) {
/* entry is a referral, don't allow add */
struct berval matched_dn;
- BVarray erefs, refs;
+ BerVarray erefs, refs;
ber_dupbv( &matched_dn, &e->e_name );
erefs = get_entry_referrals( be, conn, op, e );
if( erefs ) {
refs = referral_rewrite( erefs, &matched_dn,
base, scope );
- bvarray_free( erefs );
+ ber_bvarray_free( erefs );
}
Debug( LDAP_DEBUG_TRACE, "bdb_search: entry is referral\n",
refs ? NULL : "bad referral object",
refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
ber_memfree( matched_dn.bv_val );
return 1;
}
if ( !manageDSAit && scope != LDAP_SCOPE_BASE &&
is_entry_referral( e ) )
{
- BVarray erefs = get_entry_referrals(
+ BerVarray erefs = get_entry_referrals(
be, conn, op, e );
- BVarray refs = referral_rewrite( erefs,
+ BerVarray refs = referral_rewrite( erefs,
&e->e_name, NULL,
scope == LDAP_SCOPE_SUBTREE
? LDAP_SCOPE_SUBTREE
send_search_reference( be, conn, op,
e, refs, NULL, &v2refs );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
goto loop_continue;
}
rc = 0;
done:
- if( v2refs ) bvarray_free( v2refs );
+ if( v2refs ) ber_bvarray_free( v2refs );
if( realbase.bv_val ) ch_free( realbase.bv_val );
return rc;
char *domain = NULL;
char *hostlist = NULL;
char **hosts = NULL;
- BVarray urls = NULL;
+ BerVarray urls = NULL;
if( ndn->bv_len == 0 ) {
*text = "DNS SRV operation upon null (empty) DN disallowed";
strcpy( url.bv_val, "ldap://" );
strcpy( &url.bv_val[sizeof("ldap://")-1], hosts[i] );
- if ( bvarray_add( &urls, &url ) < 0 ) {
+ if ( ber_bvarray_add( &urls, &url ) < 0 ) {
free( url.bv_val );
*text = "problem processing DNS SRV records for DN";
goto done;
if( domain != NULL ) ch_free( domain );
if( hostlist != NULL ) ch_free( hostlist );
if( hosts != NULL ) charray_free( hosts );
- bvarray_free( urls );
+ ber_bvarray_free( urls );
return rc;
}
char **hosts = NULL;
char *refdn;
struct berval nrefdn = { 0, NULL };
- BVarray urls = NULL;
+ BerVarray urls = NULL;
assert( get_manageDSAit( op ) );
strcpy( url.bv_val, "ldap://" );
strcpy( &url.bv_val[sizeof("ldap://")-1], hosts[i] );
- if( bvarray_add( &urls, &url ) < 0 ) {
+ if( ber_bvarray_add( &urls, &url ) < 0 ) {
free( url.bv_val );
send_ldap_result( conn, op, LDAP_OTHER,
NULL, "problem processing DNS SRV records for DN",
if( domain != NULL ) ch_free( domain );
if( hostlist != NULL ) ch_free( hostlist );
if( hosts != NULL ) charray_free( hosts );
- if( urls != NULL ) bvarray_free( urls );
+ if( urls != NULL ) ber_bvarray_free( urls );
return 0;
}
int
ldap_dnattr_rewrite(
struct rewrite_info *rwinfo,
- BVarray a_vals,
+ BerVarray a_vals,
void *cookie
)
{
Entry *target,
struct berval *ndn,
AttributeDescription *entry_at,
- BVarray *vals
+ BerVarray *vals
)
{
struct ldapinfo *li = (struct ldapinfo *) be->be_private;
int rc = 1, i, j, count, is_oc;
Attribute *attr = NULL;
- BVarray abv, v;
+ BerVarray abv, v;
struct berval mapped = { 0, NULL };
char **vs = NULL;
LDAPMessage *result = NULL, *e = NULL;
return(1);
for ( count = 0; attr->a_vals[count].bv_val != NULL; count++ ) { }
- v = (BVarray) ch_calloc( (count + 1), sizeof(struct berval) );
+ v = (BerVarray) ch_calloc( (count + 1), sizeof(struct berval) );
if (v != NULL) {
for ( j = 0, abv = attr->a_vals; --count >= 0; abv++ ) {
if ( abv->bv_len > 0 ) {
}
for ( count = 0; vs[count] != NULL; count++ ) { }
- v = (BVarray) ch_calloc( (count + 1), sizeof(struct berval) );
+ v = (BerVarray) ch_calloc( (count + 1), sizeof(struct berval) );
if (v == NULL) {
goto cleanup;
}
#ifdef ENABLE_REWRITE
extern int suffix_massage_config( struct rewrite_info *info, int argc, char **argv );
-extern int ldap_dnattr_rewrite( struct rewrite_info *rwinfo, BVarray a_vals, void *cookie );
+extern int ldap_dnattr_rewrite( struct rewrite_info *rwinfo, BerVarray a_vals, void *cookie );
#endif /* ENABLE_REWRITE */
LDAP_END_DECL
attr = ent.e_attrs;
ent.e_attrs = attr->a_next;
if (attr->a_vals != &dummy)
- bvarray_free(attr->a_vals);
+ ber_bvarray_free(attr->a_vals);
ch_free(attr);
}
/* get parent with writer lock */
if ( (p = dn2entry_w( be, &pdn, &matched )) == NULL ) {
char *matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
refs == NULL ? "parent does not exist" : "parent is referral",
refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
free( matched_dn );
return -1;
if ( is_entry_referral( p ) ) {
/* parent is a referral, don't allow add */
char *matched_dn = ch_strdup( p->e_dn );
- BVarray refs = is_entry_referral( p )
+ BerVarray refs = is_entry_referral( p )
? get_entry_referrals( be, conn, op, p )
: NULL;
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
free( matched_dn );
return -1;
}
struct berval *res );
static int dnlist_subordinate(
- BVarray dnlist,
+ BerVarray dnlist,
struct berval *dn );
Entry *deref_internal_r(
Entry *entry;
Entry *sup;
unsigned depth;
- BVarray dnlist;
+ BerVarray dnlist;
assert( ( alias != NULL && dn_in == NULL )
|| ( alias == NULL && dn_in != NULL ) );
}
dnlist = NULL;
- bvarray_add( &dnlist, &dn );
+ ber_bvarray_add( &dnlist, &dn );
for( depth=0 ; ; depth++ ) {
if( entry != NULL ) {
cache_return_entry_r(&li->li_cache, entry );
entry = newe;
ber_dupbv( &dn, &entry->e_nname );
- bvarray_add( &dnlist, &dn );
+ ber_bvarray_add( &dnlist, &dn );
continue;
}
cache_return_entry_r(&li->li_cache, sup );
entry = newe;
ber_dupbv( &dn, &entry->e_nname );
- bvarray_add( &dnlist, &dn );
+ ber_bvarray_add( &dnlist, &dn );
continue;
}
}
free( dn.bv_val );
- bvarray_free( dnlist );
+ ber_bvarray_free( dnlist );
return entry;
}
}
static int dnlist_subordinate(
- BVarray dnlist,
+ BerVarray dnlist,
struct berval *dn )
{
assert( dnlist );
Entry *target,
struct berval *entry_ndn,
AttributeDescription *entry_at,
- BVarray *vals )
+ BerVarray *vals )
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Entry *e;
int rc;
Attribute *attr;
- BVarray v;
+ BerVarray v;
const char *entry_at_name = entry_at->ad_cname.bv_val;
struct berval *iv, *jv;
/* count them */
}
- v = (BVarray) ch_malloc( sizeof(struct berval) * ((iv - attr->a_vals)+1) );
+ v = (BerVarray) ch_malloc( sizeof(struct berval) * ((iv - attr->a_vals)+1) );
for ( iv=attr->a_vals, jv=v; iv->bv_val; iv++ ) {
if( conn != NULL
/* get entry with reader lock */
if ( (e = dn2entry_r( be, dn, &matched )) == NULL ) {
char *matched_dn = NULL;
- BVarray refs = NULL;
+ BerVarray refs = NULL;
if( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
NULL, NULL, NULL, NULL );
}
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
if ( matched_dn ) free( matched_dn );
return( rc );
}
if ( is_entry_referral( e ) ) {
/* entry is a referral, don't allow bind */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
#ifdef NEW_LOGGING
NULL, NULL, NULL, NULL );
}
- bvarray_free( refs );
+ ber_bvarray_free( refs );
rc = 1;
goto return_results;
/* get entry with reader lock */
if ( (e = dn2entry_r( be, ndn, &matched )) == NULL ) {
char *matched_dn = NULL;
- BVarray refs = NULL;
+ BerVarray refs = NULL;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
free( matched_dn );
return( 1 );
if (!manageDSAit && is_entry_referral( e ) ) {
/* entry is a referral, don't allow add */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
#ifdef NEW_LOGGING
send_ldap_result( conn, op, LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
- if (refs ) bvarray_free( refs );
+ if (refs ) ber_bvarray_free( refs );
rc = 1;
goto return_results;
/* get entry with writer lock */
if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char *matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
free( matched_dn );
return( -1 );
if ( !manageDSAit && is_entry_referral( e ) ) {
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
#ifdef NEW_LOGGING
send_ldap_result( conn, op, LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
rc = 1;
goto return_results;
struct berval **rspdata,
LDAPControl *** rspctrls,
const char** text,
- BVarray *refs
+ BerVarray *refs
)
{
int i;
if( idl == NULL ) break;
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
ldbm_cache_close( be, db );
if( idl == NULL ) break;
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
ldbm_cache_close( be, db );
if( idl == NULL ) break;
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
ldbm_cache_close( be, db );
Backend *be,
char *dbname,
struct berval *atname,
- BVarray vals,
+ BerVarray vals,
ID id,
int op,
slap_mask_t mask )
for( i=0; keys[i].bv_val != NULL; i++ ) {
key_change( be, db, &keys[i], id, op );
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
}
}
for( i=0; keys[i].bv_val != NULL; i++ ) {
key_change( be, db, &keys[i], id, op );
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
}
}
for( i=0; keys[i].bv_val != NULL; i++ ) {
key_change( be, db, &keys[i], id, op );
}
- bvarray_free( keys );
+ ber_bvarray_free( keys );
}
}
Backend *be,
AttributeType *type,
struct berval *lang,
- BVarray vals,
+ BerVarray vals,
ID id,
int op,
char ** dbnamep,
int index_values(
Backend *be,
AttributeDescription *desc,
- BVarray vals,
+ BerVarray vals,
ID id,
int op )
{
/* acquire and lock entry */
if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
free( matched_dn );
return( -1 );
if ( !manageDSAit && is_entry_referral( e ) ) {
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
#ifdef NEW_LOGGING
send_ldap_result( conn, op, LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
goto error_return;
}
/* get entry with writer lock */
if ( (e = dn2entry_w( be, ndn, &matched )) == NULL ) {
char* matched_dn = NULL;
- BVarray refs;
+ BerVarray refs;
if( matched != NULL ) {
matched_dn = strdup( matched->e_dn );
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
free( matched_dn );
return( -1 );
if (!manageDSAit && is_entry_referral( e ) ) {
/* parent is a referral, don't allow add */
/* parent is an alias, don't allow add */
- BVarray refs = get_entry_referrals( be,
+ BerVarray refs = get_entry_referrals( be,
conn, op, e );
#ifdef NEW_LOGGING
send_ldap_result( conn, op, LDAP_REFERRAL,
e->e_dn, NULL, refs, NULL );
- if ( refs ) bvarray_free( refs );
+ if ( refs ) ber_bvarray_free( refs );
goto return_results;
}
mod_tmp = (Modifications *)ch_malloc( sizeof( Modifications )
+ 2 * sizeof( struct berval ) );
mod_tmp->sml_desc = desc;
- mod_tmp->sml_bvalues = (BVarray)( mod_tmp + 1 );
+ mod_tmp->sml_bvalues = (BerVarray)( mod_tmp + 1 );
mod_tmp->sml_bvalues[0] = new_rdn[0][a_cnt]->la_value;
mod_tmp->sml_bvalues[1].bv_val = NULL;
mod_tmp->sml_op = SLAP_MOD_SOFTADD;
mod_tmp = (Modifications *)ch_malloc( sizeof( Modifications )
+ 2 * sizeof( struct berval ) );
mod_tmp->sml_desc = desc;
- mod_tmp->sml_bvalues = (BVarray)(mod_tmp+1);
+ mod_tmp->sml_bvalues = (BerVarray)(mod_tmp+1);
mod_tmp->sml_bvalues[0] = old_rdn[0][d_cnt]->la_value;
mod_tmp->sml_bvalues[1].bv_val = NULL;
mod_tmp->sml_op = LDAP_MOD_DELETE;
struct berval **rspdata,
LDAPControl *** rspctrls,
const char **text,
- BVarray *refs
+ BerVarray *refs
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
index_values LDAP_P((
Backend *be,
AttributeDescription *desc,
- BVarray vals,
+ BerVarray vals,
ID id,
int op ));
e = dn2entry_r( be, ndn, &matched );
if ( e == NULL ) {
char *matched_dn = NULL;
- BVarray refs = NULL;
+ BerVarray refs = NULL;
if ( matched != NULL ) {
matched_dn = ch_strdup( matched->e_dn );
/* send referrals */
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
matched_dn, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
} else if ( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc, matched_dn,
if ( is_entry_referral( e ) ) {
/* entry is a referral */
- BVarray refs = get_entry_referrals( be, conn, op, e );
- BVarray rrefs = referral_rewrite(
+ BerVarray refs = get_entry_referrals( be, conn, op, e );
+ BerVarray rrefs = referral_rewrite(
refs, &e->e_name, dn, LDAP_SCOPE_DEFAULT );
#ifdef NEW_LOGGING
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
e->e_dn, NULL, rrefs, NULL );
- bvarray_free( rrefs );
+ ber_bvarray_free( rrefs );
} else {
send_ldap_result( conn, op, rc = LDAP_OTHER, e->e_dn,
"bad referral object", NULL, NULL );
}
- if( refs != NULL ) bvarray_free( refs );
+ if( refs != NULL ) ber_bvarray_free( refs );
}
cache_return_entry_r( &li->li_cache, e );
ID_BLOCK *candidates;
ID id, cursor;
Entry *e;
- BVarray v2refs = NULL;
+ BerVarray v2refs = NULL;
Entry *matched = NULL;
struct berval realbase = { 0, NULL };
int nentries = 0;
if ( e == NULL ) {
struct berval matched_dn = { 0, NULL };
- BVarray refs = NULL;
+ BerVarray refs = NULL;
if ( matched != NULL ) {
- BVarray erefs;
+ BerVarray erefs;
ber_dupbv( &matched_dn, &matched->e_name );
erefs = is_entry_referral( matched )
refs = referral_rewrite( erefs, &matched_dn,
base, scope );
- bvarray_free( erefs );
+ ber_bvarray_free( erefs );
}
} else {
send_ldap_result( conn, op, err, matched_dn.bv_val,
text, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
ber_memfree( matched_dn.bv_val );
return 1;
}
if (!manageDSAit && is_entry_referral( e ) ) {
/* entry is a referral, don't allow add */
struct berval matched_dn;
- BVarray erefs;
- BVarray refs;
+ BerVarray erefs;
+ BerVarray refs;
ber_dupbv( &matched_dn, &e->e_name );
erefs = get_entry_referrals( be, conn, op, e );
refs = referral_rewrite( erefs, &matched_dn,
base, scope );
- bvarray_free( erefs );
+ ber_bvarray_free( erefs );
}
if( refs ) {
send_ldap_result( conn, op, LDAP_REFERRAL,
matched_dn.bv_val, NULL, refs, NULL );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
} else {
send_ldap_result( conn, op, LDAP_OTHER,
}
if( scopeok ) {
- BVarray erefs = get_entry_referrals(
+ BerVarray erefs = get_entry_referrals(
be, conn, op, e );
- BVarray refs = referral_rewrite( erefs,
+ BerVarray refs = referral_rewrite( erefs,
&e->e_name, NULL,
scope == LDAP_SCOPE_SUBTREE
? LDAP_SCOPE_SUBTREE
send_search_reference( be, conn, op,
e, refs, NULL, &v2refs );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
} else {
#ifdef NEW_LOGGING
if( candidates != NULL )
idl_free( candidates );
- if( v2refs ) bvarray_free( v2refs );
+ if( v2refs ) ber_bvarray_free( v2refs );
if( realbase.bv_val ) free( realbase.bv_val );
return rc;
Entry *target,
struct berval *ndn,
AttributeDescription *entry_at,
- BVarray *vals
+ BerVarray *vals
)
{
struct metainfo *li = ( struct metainfo * )be->be_private;
int rc = 1, i, j, count, is_oc, candidate;
Attribute *attr;
- BVarray abv, v;
+ BerVarray abv, v;
char **vs;
struct berval mapped;
LDAPMessage *result, *e;
for ( count = 0; attr->a_vals[ count ].bv_val != NULL; count++ )
;
- v = ( BVarray )ch_calloc( ( count + 1 ), sizeof( struct berval ) );
+ v = ( BerVarray )ch_calloc( ( count + 1 ), sizeof( struct berval ) );
if ( v == NULL ) {
return 1;
}
if ( vs != NULL ) {
for ( count = 0; vs[ count ] != NULL;
count++ ) { }
- v = ( BVarray )ch_calloc( ( count + 1 ),
+ v = ( BerVarray )ch_calloc( ( count + 1 ),
sizeof( struct berval ) );
if ( v == NULL ) {
ldap_value_free( vs );
attr = ent.e_attrs;
ent.e_attrs = attr->a_next;
if ( attr->a_vals != &dummy ) {
- bvarray_free( attr->a_vals );
+ ber_bvarray_free( attr->a_vals );
}
free( attr );
}
Entry *target,
struct berval *edn,
AttributeDescription *entry_at,
- BVarray *vals
+ BerVarray *vals
)
{
if ( target == NULL || !dn_match( &target->e_nname, edn ) ) {
int matchlen;
char *matched;
int nrefs;
- BVarray refs;
+ BerVarray refs;
slap_callback *prevcb;
} glue_state;
ber_int_t err,
const char *matched,
const char *text,
- BVarray ref,
+ BerVarray ref,
const char *resoid,
struct berval *resdata,
struct berval *sasldata,
}
if (ref) {
int i, j, k;
- BVarray new;
+ BerVarray new;
for (i=0; ref[i].bv_val; i++);
ber_int_t err,
const char *matched,
const char *text,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls,
int nentries
)
if (gs.matched)
free (gs.matched);
if (gs.refs)
- bvarray_free(gs.refs);
+ ber_bvarray_free(gs.refs);
return rc;
}
Entry *target,
struct berval *ndn,
AttributeDescription *ad,
- BVarray *vals
+ BerVarray *vals
)
{
BackendDB *be;
if ( (be = select_backend( &ndn, 0, 0 )) == NULL ) {
if ( default_referral ) {
- BVarray ref = referral_rewrite( default_referral,
+ BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
} else {
/* noSuchObject is not allowed to be returned by bind */
while ((*a++ = *b++) && n-- > 0) ;
return a-1;
}
-
-/* Unlike charray_add, bvarray_add does not make a new copy of the
- * source string. Typically it is used where ber_bvecadd was before,
- * and ber_bvecadd didn't duplicate its source either.
- */
-int
-bvarray_add(
- struct berval **a,
- struct berval *bv
-)
-{
- int n;
-
- if ( *a == NULL ) {
- *a = (struct berval *) ch_malloc( 2 * sizeof(struct berval) );
- n = 0;
- } else {
- for ( n = 0; *a != NULL && (*a)[n].bv_val != NULL; n++ ) {
- ; /* NULL */
- }
-
- *a = (struct berval *) ch_realloc( (char *) *a,
- (n + 2) * sizeof(struct berval) );
- }
- if ( *a == NULL ) return -1;
-
- (*a)[n++] = *bv;
- (*a)[n].bv_val = NULL;
-
- return 0;
-}
-
-void
-bvarray_free(
- struct berval *a
-)
-{
- int i;
-
- if (a) {
- for (i=0; a[i].bv_val; i++)
- free(a[i].bv_val);
- free(a);
- }
-}
* if we don't hold it.
*/
if ( (be = select_backend( &ndn, manageDSAit, 0 )) == NULL ) {
- BVarray ref = referral_rewrite( default_referral,
+ BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
rc = 0;
goto cleanup;
}
* if we don't hold it.
*/
if ( (be = select_backend( &ndn, manageDSAit, 0 )) == NULL ) {
- BVarray ref = referral_rewrite( default_referral,
+ BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
goto cleanup;
}
}
#ifndef SLAPD_MULTIMASTER
} else {
- BVarray defref = be->be_update_refs
+ BerVarray defref = be->be_update_refs
? be->be_update_refs : default_referral;
- BVarray ref = referral_rewrite( default_referral,
+ BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
ref ? ref : defref, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
#endif
}
const char *text;
AttributeDescription *ad;
unsigned char *ptr = (unsigned char *)bv->bv_val;
- BVarray bptr;
+ BerVarray bptr;
i = entry_getlen(&ptr);
x = ch_malloc(i);
* pointer can never be NULL
*/
x->e_attrs = (Attribute *)(x+1);
- bptr = (BVarray)x->e_attrs;
+ bptr = (BerVarray)x->e_attrs;
a = NULL;
while (i = entry_getlen(&ptr)) {
}
ptr += i + 1;
a->a_desc = ad;
- bptr = (BVarray)(a+1);
+ bptr = (BerVarray)(a+1);
a->a_vals = bptr;
a->a_flags = 0;
j = entry_getlen(&ptr);
ber_len_t len;
struct extop_list *ext;
const char *text;
- BVarray refs;
+ BerVarray refs;
char *rspoid;
struct berval *rspdata;
LDAPControl **rspctrls;
send_ldap_extended( conn, op, rc, NULL, text, refs,
rspoid, rspdata, rspctrls );
- bvarray_free( refs );
+ ber_bvarray_free( refs );
}
if ( rspoid != NULL ) {
goto return_error;
}
- bvarray_add( &f->f_sub_any, &value );
+ ber_bvarray_add( &f->f_sub_any, &value );
if( fstr->bv_val ) {
int i = fstr->bv_len;
}
free( f->f_sub_initial.bv_val );
- bvarray_free( f->f_sub_any );
+ ber_bvarray_free( f->f_sub_any );
free( f->f_sub_final.bv_val );
ch_free( f->f_sub );
return rc;
if ( f->f_sub_initial.bv_val != NULL ) {
free( f->f_sub_initial.bv_val );
}
- bvarray_free( f->f_sub_any );
+ ber_bvarray_free( f->f_sub_any );
if ( f->f_sub_final.bv_val != NULL ) {
free( f->f_sub_final.bv_val );
}
int ldap_syslog_level = LOG_DEBUG;
#endif
-BVarray default_referral = NULL;
+BerVarray default_referral = NULL;
/*
* global variables that need mutex protection
* if we don't hold it.
*/
if ( (be = select_backend( &ndn, manageDSAit, 0 )) == NULL ) {
- BVarray ref = referral_rewrite( default_referral,
+ BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
goto cleanup;
}
#ifndef SLAPD_MULTIMASTER
/* send a referral */
} else {
- BVarray defref = be->be_update_refs
+ BerVarray defref = be->be_update_refs
? be->be_update_refs : default_referral;
- BVarray ref = referral_rewrite( defref,
+ BerVarray ref = referral_rewrite( defref,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
ref ? ref : defref, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
#endif
}
} else {
mod->sml_op = mop;
mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_structuralObjectClass;
- mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
+ mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &tmpval );
mod->sml_bvalues[1].bv_val = NULL;
assert( mod->sml_bvalues[0].bv_val );
mod->sml_op = mop;
mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_entryUUID;
- mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
+ mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &tmpval );
mod->sml_bvalues[1].bv_val = NULL;
assert( mod->sml_bvalues[0].bv_val );
mod->sml_op = mop;
mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_creatorsName;
- mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
+ mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &name );
mod->sml_bvalues[1].bv_val = NULL;
assert( mod->sml_bvalues[0].bv_val );
mod->sml_op = mop;
mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_createTimestamp;
- mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
+ mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], ×tamp );
mod->sml_bvalues[1].bv_val = NULL;
assert( mod->sml_bvalues[0].bv_val );
mod->sml_op = mop;
mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_entryCSN;
- mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
+ mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &csn );
mod->sml_bvalues[1].bv_val = NULL;
assert( mod->sml_bvalues[0].bv_val );
mod->sml_op = mop;
mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_modifiersName;
- mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
+ mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], &name );
mod->sml_bvalues[1].bv_val = NULL;
assert( mod->sml_bvalues[0].bv_val );
mod->sml_op = mop;
mod->sml_type.bv_val = NULL;
mod->sml_desc = slap_schema.si_ad_modifyTimestamp;
- mod->sml_bvalues = (BVarray) ch_malloc( 2 * sizeof( struct berval ) );
+ mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
ber_dupbv( &mod->sml_bvalues[0], ×tamp );
mod->sml_bvalues[1].bv_val = NULL;
assert( mod->sml_bvalues[0].bv_val );
* if we don't hold it.
*/
if ( (be = select_backend( &ndn, manageDSAit, 0 )) == NULL ) {
- BVarray ref = referral_rewrite( default_referral,
+ BerVarray ref = referral_rewrite( default_referral,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
goto cleanup;
}
}
#ifndef SLAPD_MULTIMASTER
} else {
- BVarray defref = be->be_update_refs
+ BerVarray defref = be->be_update_refs
? be->be_update_refs : default_referral;
- BVarray ref = referral_rewrite( defref,
+ BerVarray ref = referral_rewrite( defref,
NULL, &pdn, LDAP_SCOPE_DEFAULT );
send_ldap_result( conn, op, rc = LDAP_REFERRAL, NULL, NULL,
ref ? ref : defref, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
#endif
}
} else {
free( mod->sm_type.bv_val );
#endif
if ( mod->sm_bvalues != NULL )
- bvarray_free( mod->sm_bvalues );
+ ber_bvarray_free( mod->sm_bvalues );
if( freeit )
free( mod );
struct berval **rspdata,
LDAPControl ***rspctrls,
const char **text,
- BVarray *refs )
+ BerVarray *refs )
{
int rc;
LDAP_SLAPD_F (int) attr_merge LDAP_P(( Entry *e,
AttributeDescription *desc,
- BVarray vals ));
+ BerVarray vals ));
LDAP_SLAPD_F (Attribute *) attrs_find LDAP_P((
Attribute *a, AttributeDescription *desc ));
LDAP_SLAPD_F (Attribute *) attr_find LDAP_P((
Entry *target,
struct berval *entry_ndn,
AttributeDescription *entry_at,
- BVarray *vals
+ BerVarray *vals
));
LDAP_SLAPD_F (Attribute *) backend_operational(
LDAP_SLAPD_F (int) charray_strcmp LDAP_P(( const char **a1, const char **a2 ));
LDAP_SLAPD_F (int) charray_strcasecmp LDAP_P(( const char **a1, const char **a2 ));
-LDAP_SLAPD_F (int) bvarray_add LDAP_P(( BVarray *a, struct berval *bv ));
-LDAP_SLAPD_F (void) bvarray_free LDAP_P(( struct berval *a ));
-
LDAP_SLAPD_F (char *) slap_strcopy LDAP_P((
char *dst, const char *src ));
LDAP_SLAPD_F (char *) slap_strncopy LDAP_P((
struct berval ** rspdata,
LDAPControl *** rspctrls,
const char ** text,
- BVarray *refs ));
+ BerVarray *refs ));
typedef int (SLAP_EXTOP_GETOID_FN) LDAP_P((
int index, char *oid, int blen ));
LDAP_SLAPD_F (int) validate_global_referral LDAP_P((
const char *url ));
-LDAP_SLAPD_F (BVarray) get_entry_referrals LDAP_P((
+LDAP_SLAPD_F (BerVarray) get_entry_referrals LDAP_P((
Backend *be, Connection *conn, Operation *op, Entry *e ));
-LDAP_SLAPD_F (BVarray) referral_rewrite LDAP_P((
- BVarray refs,
+LDAP_SLAPD_F (BerVarray) referral_rewrite LDAP_P((
+ BerVarray refs,
struct berval *base,
struct berval *target,
int scope ));
LDAP_SLAPD_F (void) send_ldap_result LDAP_P((
Connection *conn, Operation *op,
ber_int_t err, const char *matched, const char *text,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls ));
LDAP_SLAPD_F (void) send_ldap_sasl LDAP_P((
Connection *conn, Operation *op,
ber_int_t err, const char *matched,
const char *text,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls,
struct berval *cred ));
LDAP_SLAPD_F (void) send_ldap_extended LDAP_P((
Connection *conn, Operation *op,
ber_int_t err, const char *matched,
- const char *text, BVarray refs,
+ const char *text, BerVarray refs,
const char *rspoid, struct berval *rspdata,
LDAPControl **ctrls ));
LDAP_SLAPD_F (void) send_search_result LDAP_P((
Connection *conn, Operation *op,
ber_int_t err, const char *matched, const char *text,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls,
int nentries ));
LDAP_SLAPD_F (int) send_search_reference LDAP_P((
Backend *be, Connection *conn, Operation *op,
- Entry *e, BVarray refs,
+ Entry *e, BerVarray refs,
LDAPControl **ctrls,
- BVarray *v2refs ));
+ BerVarray *v2refs ));
LDAP_SLAPD_F (int) send_search_entry LDAP_P((
Backend *be, Connection *conn, Operation *op,
*/
LDAP_SLAPD_F( int ) oc_check_allowed(
AttributeType *type,
- BVarray oclist,
+ BerVarray oclist,
ObjectClass *sc );
LDAP_SLAPD_F( int ) structural_class(
- BVarray ocs,
+ BerVarray ocs,
struct berval *scbv,
ObjectClass **sc,
const char **text,
LDAP_SLAPD_F (int) value_find_ex LDAP_P((
AttributeDescription *ad,
unsigned flags,
- BVarray values,
+ BerVarray values,
struct berval *value ));
LDAP_SLAPD_F (int) value_add LDAP_P((
- BVarray *vals,
- BVarray addvals ));
+ BerVarray *vals,
+ BerVarray addvals ));
/*
* user.c
LDAP_SLAPD_V (slap_mask_t) global_requires;
LDAP_SLAPD_V (slap_ssf_set_t) global_ssf_set;
-LDAP_SLAPD_V (BVarray) default_referral;
+LDAP_SLAPD_V (BerVarray) default_referral;
LDAP_SLAPD_V (char *) replogfile;
LDAP_SLAPD_V (const char) Versionstr[];
LDAP_SLAPD_V (struct slap_limits_set) deflimit;
return rc;
}
-BVarray referral_rewrite(
- BVarray in,
+BerVarray referral_rewrite(
+ BerVarray in,
struct berval *base,
struct berval *target,
int scope )
{
int i;
- BVarray refs;
+ BerVarray refs;
struct berval *iv, *jv;
if( in == NULL ) return NULL;
}
-BVarray get_entry_referrals(
+BerVarray get_entry_referrals(
Backend *be,
Connection *conn,
Operation *op,
Entry *e )
{
Attribute *attr;
- BVarray refs;
+ BerVarray refs;
unsigned i;
struct berval *iv, *jv;
#include "slap.h"
-static char *v2ref( BVarray ref, const char *text )
+static char *v2ref( BerVarray ref, const char *text )
{
size_t len = 0, i = 0;
char *v2;
ber_int_t err,
const char *matched,
const char *text,
- BVarray ref,
+ BerVarray ref,
const char *resoid,
struct berval *resdata,
struct berval *sasldata,
ber_int_t err,
const char *matched,
const char *text,
- BVarray ref,
+ BerVarray ref,
LDAPControl **ctrls
)
{
ber_int_t err,
const char *matched,
const char *text,
- BVarray ref,
+ BerVarray ref,
LDAPControl **ctrls,
struct berval *cred
)
ber_int_t err,
const char *matched,
const char *text,
- BVarray refs,
+ BerVarray refs,
const char *rspoid,
struct berval *rspdata,
LDAPControl **ctrls
ber_int_t err,
const char *matched,
const char *text,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls,
int nentries
)
Connection *conn,
Operation *op,
Entry *e,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls,
- BVarray *v2refs
+ BerVarray *v2refs
)
{
char berbuf[256];
/* Two empty callback functions to avoid sending results */
static void sasl_sc_r( Connection *conn, Operation *o, ber_tag_t tag,
ber_int_t msgid, ber_int_t err, const char *matched,
- const char *text, BVarray ref, const char *resoid,
+ const char *text, BerVarray ref, const char *resoid,
struct berval *resdata, struct berval *sasldata, LDAPControl **c)
{
}
static void sasl_sc_s( Connection *conn, Operation *o, ber_int_t err,
- const char *matched, const char *text, BVarray refs, LDAPControl **c,
+ const char *matched, const char *text, BerVarray refs, LDAPControl **c,
int nentries)
{
}
{
const char *errmsg;
int i, rc;
- BVarray vals=NULL;
+ BerVarray vals=NULL;
AttributeDescription *ad=NULL;
struct berval bv;
rc = LDAP_INAPPROPRIATE_AUTH;
COMPLETE:
- if( vals ) bvarray_free( vals );
+ if( vals ) ber_bvarray_free( vals );
#ifdef NEW_LOGGING
LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
int oc_check_allowed(
AttributeType *at,
- BVarray ocl,
+ BerVarray ocl,
ObjectClass *sc )
{
int i, j;
* Determine the structural object class from a set of OIDs
*/
int structural_class(
- BVarray ocs,
+ BerVarray ocs,
struct berval *scbv,
ObjectClass **scp,
const char **text,
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
int i;
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval digest;
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval *value = (struct berval *) assertValue;
err:
if ( nsa->sa_final.bv_val ) free( nsa->sa_final.bv_val );
- if ( nsa->sa_any )bvarray_free( nsa->sa_any );
+ if ( nsa->sa_any )ber_bvarray_free( nsa->sa_any );
if ( nsa->sa_initial.bv_val ) free( nsa->sa_initial.bv_val );
ch_free( nsa );
return NULL;
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
char *val, *c;
int i,j, len, wordcount, keycount=0;
struct berval *newkeys;
- BVarray keys=NULL;
+ BerVarray keys=NULL;
for( j=0; values[j].bv_val != NULL; j++ ) {
/* Yes, this is necessary */
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
char *val, *c;
int i, count, len;
- BVarray keys;
+ BerVarray keys;
/* Yes, this is necessary */
val = UTF8normalize( ((struct berval *)assertValue),
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
int i;
- BVarray *keys;
+ BerVarray *keys;
char *s;
for( i=0; values[i].bv_val != NULL; i++ ) {
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
- BVarray keys;
+ BerVarray keys;
char *s;
keys = (struct berval *)ch_malloc( sizeof( struct berval * ) * 2 );
if ( sub->sa_final.bv_val )
ch_free( sub->sa_final.bv_val );
if ( sub->sa_any )
- bvarray_free( sub->sa_any );
+ ber_bvarray_free( sub->sa_any );
if ( sub->sa_initial.bv_val )
ch_free( sub->sa_initial.bv_val );
ch_free( sub );
free( nav );
if( sub != NULL ) {
if ( sub->sa_final.bv_val ) free( sub->sa_final.bv_val );
- if ( sub->sa_any ) bvarray_free( sub->sa_any );
+ if ( sub->sa_any ) ber_bvarray_free( sub->sa_any );
if ( sub->sa_initial.bv_val ) free( sub->sa_initial.bv_val );
ch_free( sub );
}
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
int i;
unsigned casefold;
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval digest;
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
unsigned casefold;
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval value;
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
unsigned casefold;
ber_len_t i, nkeys;
size_t slen, mlen;
- BVarray keys;
- BVarray nvalues;
+ BerVarray keys;
+ BerVarray nvalues;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
if( nkeys == 0 ) {
/* no keys to generate */
*keysp = NULL;
- bvarray_free( nvalues );
+ ber_bvarray_free( nvalues );
return LDAP_SUCCESS;
}
*keysp = NULL;
}
- bvarray_free( nvalues );
+ ber_bvarray_free( nvalues );
return LDAP_SUCCESS;
}
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
SubstringsAssertion *sa;
char pre;
unsigned casefold;
ber_len_t nkeys = 0;
size_t slen, mlen, klen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval *value;
if( nkeys == 0 ) {
if ( sa->sa_final.bv_val ) free( sa->sa_final.bv_val );
- if ( sa->sa_any ) bvarray_free( sa->sa_any );
+ if ( sa->sa_any ) ber_bvarray_free( sa->sa_any );
if ( sa->sa_initial.bv_val ) free( sa->sa_initial.bv_val );
ch_free( sa );
*keysp = NULL;
*keysp = NULL;
}
if ( sa->sa_final.bv_val ) free( sa->sa_final.bv_val );
- if ( sa->sa_any ) bvarray_free( sa->sa_any );
+ if ( sa->sa_any ) ber_bvarray_free( sa->sa_any );
if ( sa->sa_initial.bv_val ) free( sa->sa_initial.bv_val );
ch_free( sa );
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
int i;
- BVarray keys;
+ BerVarray keys;
/* we should have at least one value at this point */
assert( values != NULL && values[0].bv_val != NULL );
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
- BVarray keys;
+ BerVarray keys;
keys = ch_malloc( sizeof( struct berval ) * 2 );
integerNormalize( syntax, assertValue, &keys[0] );
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
int i;
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval digest;
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval *value;
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
ber_len_t i, nkeys;
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval digest;
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
SubstringsAssertion *sa = assertValue;
char pre;
ber_len_t nkeys = 0;
size_t slen, mlen, klen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval *value;
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
int i;
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval digest;
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval value;
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
ber_len_t i, nkeys;
size_t slen, mlen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval digest;
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
SubstringsAssertion *sa = assertValue;
char pre;
ber_len_t nkeys = 0;
size_t slen, mlen, klen;
- BVarray keys;
+ BerVarray keys;
HASH_CONTEXT HASHcontext;
unsigned char HASHdigest[HASH_BYTES];
struct berval value;
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keysp )
+ BerVarray values,
+ BerVarray *keysp )
{
int i;
- BVarray keys;
+ BerVarray keys;
X509 *xcert;
unsigned char *p;
struct berval * serial;
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keysp )
+ BerVarray *keysp )
{
- BVarray keys;
+ BerVarray keys;
struct berval *asserted_serial;
struct berval *asserted_issuer_dn;
* if we don't hold it.
*/
if ( (be = select_backend( &nbase, manageDSAit, 1 )) == NULL ) {
- BVarray ref = referral_rewrite( default_referral,
+ BerVarray ref = referral_rewrite( default_referral,
NULL, &pbase, scope );
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, ref ? ref : default_referral, NULL );
- bvarray_free( ref );
+ ber_bvarray_free( ref );
goto return_results;
}
#include "slap.h"
#include "sets.h"
-static BVarray set_join (BVarray lset, int op, BVarray rset);
-static BVarray set_chase (SLAP_SET_GATHER gatherer,
- void *cookie, BVarray set, struct berval *attr, int closure);
+static BerVarray set_join (BerVarray lset, int op, BerVarray rset);
+static BerVarray set_chase (SLAP_SET_GATHER gatherer,
+ void *cookie, BerVarray set, struct berval *attr, int closure);
static int set_samedn (char *dn1, char *dn2);
long
-slap_set_size (BVarray set)
+slap_set_size (BerVarray set)
{
int i;
}
void
-slap_set_dispose (BVarray set)
+slap_set_dispose (BerVarray set)
{
- bvarray_free(set);
+ ber_bvarray_free(set);
}
-static BVarray
-set_join (BVarray lset, int op, BVarray rset)
+static BerVarray
+set_join (BerVarray lset, int op, BerVarray rset)
{
- BVarray set;
+ BerVarray set;
long i, j, last;
set = NULL;
return(set);
}
-static BVarray
+static BerVarray
set_chase (SLAP_SET_GATHER gatherer,
- void *cookie, BVarray set, struct berval *attr, int closure)
+ void *cookie, BerVarray set, struct berval *attr, int closure)
{
- BVarray vals, nset;
+ BerVarray vals, nset;
char attrstr[32];
struct berval bv = {attr->bv_len, attrstr};
int i;
int
slap_set_filter (SLAP_SET_GATHER gatherer,
void *cookie, struct berval *fbv,
- char *user, char *this, BVarray *results)
+ char *user, char *this, BerVarray *results)
{
#define IS_SET(x) ( (long)(x) >= 256 )
#define IS_OP(x) ( (long)(x) < 256 )
#define SF_ERROR(x) do { rc = -1; goto _error; } while (0)
-#define SF_TOP() ( (BVarray)( (stp < 0) ? 0 : stack[stp] ) )
-#define SF_POP() ( (BVarray)( (stp < 0) ? 0 : stack[stp--] ) )
+#define SF_TOP() ( (BerVarray)( (stp < 0) ? 0 : stack[stp] ) )
+#define SF_POP() ( (BerVarray)( (stp < 0) ? 0 : stack[stp--] ) )
#define SF_PUSH(x) do { \
if (stp >= 63) SF_ERROR(overflow); \
- stack[++stp] = (BVarray)(long)(x); \
+ stack[++stp] = (BerVarray)(long)(x); \
} while (0)
- BVarray set, lset;
- BVarray stack[64];
+ BerVarray set, lset;
+ BerVarray stack[64];
int len, op, rc, stp;
char c, *filter = fbv->bv_val;
* also return the syntax or some "comparison cookie"
* that is used by set_filter.
*/
-typedef BVarray (SLAP_SET_GATHER)(
+typedef BerVarray (SLAP_SET_GATHER)(
void *cookie, char *name, struct berval *attr);
-LDAP_SLAPD_F (long) slap_set_size (BVarray set);
-LDAP_SLAPD_F (void) slap_set_dispose (BVarray set);
+LDAP_SLAPD_F (long) slap_set_size (BerVarray set);
+LDAP_SLAPD_F (void) slap_set_dispose (BerVarray set);
LDAP_SLAPD_F (int)
slap_set_filter (SLAP_SET_GATHER gatherer,
void *cookie, struct berval *filter,
- char *user, char *this, BVarray *results);
+ char *user, char *this, BerVarray *results);
struct slap_syntax *syntax, /* syntax of stored value */
struct slap_matching_rule *mr,
struct berval *prefix,
- BVarray values,
- BVarray *keys ));
+ BerVarray values,
+ BerVarray *keys ));
/* Filter index function */
typedef int slap_mr_filter_func LDAP_P((
struct slap_matching_rule *mr,
struct berval *prefix,
void * assertValue,
- BVarray *keys ));
+ BerVarray *keys ));
typedef struct slap_matching_rule {
LDAPMatchingRule smr_mrule;
*/
typedef struct slap_attr {
AttributeDescription *a_desc;
- BVarray a_vals;
+ BerVarray a_vals;
struct slap_attr *a_next;
unsigned a_flags;
#define SLAP_ATTR_IXADD 0x1U
int sm_op;
AttributeDescription *sm_desc;
struct berval sm_type;
- BVarray sm_bvalues;
+ BerVarray sm_bvalues;
} Modification;
typedef struct slap_mod_list {
struct slap_replica_info **be_replica; /* replicas of this backend (in master) */
char *be_replogfile; /* replication log file (in master) */
struct berval be_update_ndn; /* allowed to make changes (in replicas) */
- BVarray be_update_refs; /* where to refer modifying clients to */
+ BerVarray be_update_refs; /* where to refer modifying clients to */
char *be_realm;
void *be_private; /* anything the backend database needs */
struct berval ** rspdata,
LDAPControl *** rspctrls,
const char ** text,
- BVarray *refs ));
+ BerVarray *refs ));
typedef int (BI_entry_release_rw) LDAP_P((BackendDB *bd,
struct slap_conn *c, struct slap_op *o,
struct slap_conn *c, struct slap_op *o,
Entry *e, struct berval *edn,
AttributeDescription *entry_at,
- BVarray *vals ));
+ BerVarray *vals ));
typedef int (BI_operational) LDAP_P((Backend *bd,
struct slap_conn *c, struct slap_op *o,
typedef void (slap_response)( struct slap_conn *, struct slap_op *,
ber_tag_t, ber_int_t, ber_int_t, const char *, const char *,
- BVarray, const char *, struct berval *,
+ BerVarray, const char *, struct berval *,
struct berval *, LDAPControl ** );
typedef void (slap_sresult)( struct slap_conn *, struct slap_op *,
- ber_int_t, const char *, const char *, BVarray,
+ ber_int_t, const char *, const char *, BerVarray,
LDAPControl **, int nentries);
typedef int (slap_sendentry)( BackendDB *, struct slap_conn *,
struct berval ** rspdata,
LDAPControl ***rspctrls,
const char ** text,
- BVarray * refs )
+ BerVarray * refs )
{
void *ctx;
int rc;
ber_int_t err,
const char *matched,
const char *text,
- BVarray refs,
+ BerVarray refs,
const char *rspoid,
struct berval *rspdata,
LDAPControl **ctrls
ber_int_t err,
const char *matched,
const char *text,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls,
struct berval *cred
)
ber_int_t err,
const char *matched,
const char *text,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls
)
{
ber_int_t err,
const char *matched,
const char *text,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls,
int nentries
)
Connection *conn,
Operation *op,
Entry *e,
- BVarray refs,
+ BerVarray refs,
LDAPControl **ctrls,
- BVarray *v2refs
+ BerVarray *v2refs
)
{
assert(0);
int
value_add(
- BVarray *vals,
- BVarray addvals
+ BerVarray *vals,
+ BerVarray addvals
)
{
int n, nn;
- BVarray v2;
+ BerVarray v2;
for ( nn = 0; addvals != NULL && addvals[nn].bv_val != NULL; nn++ )
; /* NULL */
if ( *vals == NULL ) {
- *vals = (BVarray) ch_malloc( (nn + 1)
+ *vals = (BerVarray) ch_malloc( (nn + 1)
* sizeof(struct berval) );
n = 0;
} else {
for ( n = 0; (*vals)[n].bv_val != NULL; n++ ) {
; /* Empty */
}
- *vals = (BVarray) ch_realloc( (char *) *vals,
+ *vals = (BerVarray) ch_realloc( (char *) *vals,
(n + nn + 1) * sizeof(struct berval) );
}
int value_find_ex(
AttributeDescription *ad,
unsigned flags,
- BVarray vals,
+ BerVarray vals,
struct berval *val )
{
int i;