goto done;
}
- if ( mlist->sml_bvalues == NULL ) break;
+ if ( mlist->sml_values == NULL ) break;
/* fall thru to check value to add */
case LDAP_MOD_ADD:
- assert( mlist->sml_bvalues != NULL );
+ assert( mlist->sml_values != NULL );
for ( bv = mlist->sml_nvalues
? mlist->sml_nvalues : mlist->sml_values;
break;
case LDAP_MOD_DELETE:
- if ( mlist->sml_bvalues == NULL ) {
+ if ( mlist->sml_values == NULL ) {
if ( ! access_allowed( op, e,
mlist->sml_desc, NULL, ACL_WRITE, NULL ) )
{
#ifdef LDAP_SLAPI
#include "slapi/slapi.h"
-static void init_add_pblock( Operation *op, struct berval *dn, Entry *e, int manageDSAit );
+static void init_add_pblock( Operation *op, struct berval *dn, Entry *e,
+ int manageDSAit );
static int call_add_preop_plugins( Operation *op );
static void call_add_postop_plugins( Operation *op );
#endif /* LDAP_SLAPI */
e = (Entry *) ch_calloc( 1, sizeof(Entry) );
- rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
+ rs->sr_err = dnPrettyNormal( NULL, &dn, &op->o_req_dn, &op->o_req_ndn,
+ op->o_tmpmemctx );
if( rs->sr_err != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
/* check if the values we're adding already exist */
if( mr == NULL || !mr->smr_match ) {
- for ( i = 0; mods->sml_bvalues[i].bv_val != NULL; i++ ) {
+ for ( i = 1; mods->sml_values[i].bv_val != NULL; i++ ) {
/* test asserted values against themselves */
for( j = 0; j < i; j++ ) {
- if ( bvmatch( &mods->sml_bvalues[i],
- &mods->sml_bvalues[j] ) ) {
+ if ( bvmatch( &mods->sml_values[i],
+ &mods->sml_values[j] ) )
+ {
/* value exists already */
snprintf( textbuf, textlen,
"%s: value #%d provided more than once",
int rc = LDAP_SUCCESS;
int match;
- for ( i = 0; mods->sml_values[i].bv_val != NULL; i++ ) {
+ for ( i = 1; mods->sml_values[i].bv_val != NULL; i++ ) {
/* test asserted values against themselves */
for( j = 0; j < i; j++ ) {
rc = value_match( &match, mods->sml_desc, mr,
- SLAP_MR_EQUALITY | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
+ SLAP_MR_EQUALITY
+ | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
| SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
| SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
mods->sml_nvalues
/* move ad to attr structure */
attr->a_desc = mods->sml_desc;
- if ( !dup )
- mods->sml_desc = NULL;
+ if ( !dup ) mods->sml_desc = NULL;
/* move values to attr structure */
/* should check for duplicates */
if ( dup ) {
int i;
- for ( i = 0; mods->sml_values[i].bv_val; i++ ) ;
+ for ( i = 0; mods->sml_values[i].bv_val; i++ ) /* EMPTY */;
attr->a_vals = (BerVarray) ch_calloc( i+1, sizeof( BerValue ));
- for ( i = 0; mods->sml_values[i].bv_val; i++ )
+ for ( i = 0; mods->sml_values[i].bv_val; i++ ) {
ber_dupbv( &attr->a_vals[i], &mods->sml_values[i] );
+ }
attr->a_vals[i].bv_len = 0;
attr->a_vals[i].bv_val = NULL;
} else {
if ( mods->sml_nvalues ) {
if ( dup ) {
int i;
- for ( i = 0; mods->sml_nvalues[i].bv_val; i++ ) ;
+ for ( i = 0; mods->sml_nvalues[i].bv_val; i++ ) /* EMPTY */;
attr->a_nvals = (BerVarray) ch_calloc( i+1, sizeof( BerValue ));
- for ( i = 0; mods->sml_nvalues[i].bv_val; i++ )
+ for ( i = 0; mods->sml_nvalues[i].bv_val; i++ ) {
ber_dupbv( &attr->a_nvals[i], &mods->sml_nvalues[i] );
+ }
attr->a_nvals[i].bv_len = 0;
attr->a_nvals[i].bv_val = NULL;
} else {
mod->sml_type = a_new_desc->ad_cname;
- for ( count = 0; a_new->a_vals[count].bv_val; count++ );
+ for ( count = 0; a_new->a_vals[count].bv_val; count++ ) /* EMPTY */;
- mod->sml_bvalues = (struct berval*) malloc(
- (count+1) * sizeof( struct berval) );
+ mod->sml_values = (struct berval*) malloc(
+ (count+1) * sizeof( struct berval) );
/* see slap_mods_check() comments...
* if a_vals == a_nvals, there is no normalizer.
}
for ( i = 0; i < count; i++ ) {
- ber_dupbv(mod->sml_bvalues+i, a_new->a_vals+i);
+ ber_dupbv(mod->sml_values+i, a_new->a_vals+i);
if ( mod->sml_nvalues ) {
ber_dupbv( mod->sml_nvalues+i, a_new->a_vals+i );
}
}
- mod->sml_bvalues[count].bv_val = 0;
- mod->sml_bvalues[count].bv_len = 0;
+ mod->sml_values[count].bv_val = NULL;
+ mod->sml_values[count].bv_len = 0;
if ( mod->sml_nvalues ) {
- mod->sml_nvalues[count].bv_val = 0;
+ mod->sml_nvalues[count].bv_val = NULL;
mod->sml_nvalues[count].bv_len = 0;
}
BerElement *ber,
AttributeAssertion **ava,
unsigned usage,
- const char **text
-)
+ const char **text )
{
int rc;
ber_tag_t rtag;
modvals[1].bv_len = 0;
mod.sml_op = LDAP_MOD_REPLACE;
- mod.sml_bvalues = modvals;
+ mod.sml_values = modvals;
mod.sml_nvalues = NULL;
mod.sml_desc = slap_schema.si_ad_contextCSN;
mod.sml_type = mod.sml_desc->ad_cname;
mods[i].mod_op = ml->sml_op | LDAP_MOD_BVALUES;
mods[i].mod_type = mapped.bv_val;
- if ( ml->sml_bvalues != NULL ) {
+ if ( ml->sml_values != NULL ) {
if ( is_oc ) {
- for (j = 0; ml->sml_bvalues[j].bv_val; j++);
- mods[i].mod_bvalues = (struct berval **)ch_malloc((j+1) *
+ for (j = 0; ml->sml_values[j].bv_val; j++);
+ mods[i].mod_values = (struct berval **)ch_malloc((j+1) *
sizeof(struct berval *));
- for (j = 0; ml->sml_bvalues[j].bv_val; j++) {
+ for (j = 0; ml->sml_values[j].bv_val; j++) {
ldap_back_map(&li->rwmap.rwm_oc,
- &ml->sml_bvalues[j],
+ &ml->sml_values[j],
&mapped, BACKLDAP_MAP);
if (mapped.bv_val == NULL || mapped.bv_val[0] == '\0') {
continue;
}
- mods[i].mod_bvalues[j] = &mapped;
+ mods[i].mod_values[j] = &mapped;
}
- mods[i].mod_bvalues[j] = NULL;
+ mods[i].mod_values[j] = NULL;
} else {
if ( ml->sml_desc->ad_type->sat_syntax ==
slap_schema.si_syn_distinguishedName ) {
- ldap_dnattr_rewrite( &dc, ml->sml_bvalues );
+ ldap_dnattr_rewrite( &dc, ml->sml_values );
}
- if ( ml->sml_bvalues == NULL ) {
+ if ( ml->sml_values == NULL ) {
continue;
}
- for (j = 0; ml->sml_bvalues[j].bv_val; j++);
- mods[i].mod_bvalues = (struct berval **)ch_malloc((j+1) *
+ for (j = 0; ml->sml_values[j].bv_val; j++);
+ mods[i].mod_values = (struct berval **)ch_malloc((j+1) *
sizeof(struct berval *));
- for (j = 0; ml->sml_bvalues[j].bv_val; j++)
- mods[i].mod_bvalues[j] = &ml->sml_bvalues[j];
- mods[i].mod_bvalues[j] = NULL;
+ for (j = 0; ml->sml_values[j].bv_val; j++)
+ mods[i].mod_values[j] = &ml->sml_values[j];
+ mods[i].mod_values[j] = NULL;
}
} else {
- mods[i].mod_bvalues = NULL;
+ mods[i].mod_values = NULL;
}
i++;
free( mdn.bv_val );
}
for (i=0; modv[i]; i++) {
- ch_free(modv[i]->mod_bvalues);
+ ch_free(modv[i]->mod_values);
}
ch_free( mods );
ch_free( modv );
Entry *e,
const char **text,
char *textbuf,
- size_t textlen
-)
+ size_t textlen )
{
int rc = LDAP_SUCCESS;
Modification *mod;
Attribute *ap;
#ifdef NEW_LOGGING
- LDAP_LOG( BACK_LDBM, ENTRY, "ldbm_modify_internal: %s\n", e->e_name.bv_val, 0, 0 );
+ LDAP_LOG( BACK_LDBM, ENTRY,
+ "ldbm_modify_internal: %s\n",
+ e->e_name.bv_val,
+ get_permissiveModify(op) ? " (permissive)" : "",
+ 0 );
#else
- Debug(LDAP_DEBUG_TRACE, "ldbm_modify_internal: %s\n", e->e_name.bv_val, 0, 0);
+ Debug(LDAP_DEBUG_TRACE,
+ "ldbm_modify_internal: %s\n",
+ e->e_name.bv_val,
+ get_permissiveModify(op) ? " (permissive)" : "",
+ 0 );
#endif
-
if ( !acl_check_modlist( op, e, modlist )) {
return LDAP_INSUFFICIENT_ACCESS;
}
switch ( mod->sm_op ) {
case LDAP_MOD_ADD:
#ifdef NEW_LOGGING
- LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal: add\n", 0, 0, 0);
+ LDAP_LOG( BACK_LDBM, DETAIL1,
+ "ldbm_modify_internal: add\n", 0, 0, 0);
#else
- Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: add\n", 0, 0, 0);
+ Debug(LDAP_DEBUG_ARGS,
+ "ldbm_modify_internal: add\n", 0, 0, 0);
#endif
rc = modify_add_values( e, mod, get_permissiveModify( op ),
- text, textbuf, textlen );
+ text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
case LDAP_MOD_DELETE:
#ifdef NEW_LOGGING
- LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal: delete\n", 0,0,0);
+ LDAP_LOG( BACK_LDBM, DETAIL1,
+ "ldbm_modify_internal: delete\n", 0,0,0);
#else
- Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: delete\n", 0, 0, 0);
+ Debug(LDAP_DEBUG_ARGS,
+ "ldbm_modify_internal: delete\n", 0, 0, 0);
#endif
rc = modify_delete_values( e, mod, get_permissiveModify( op ),
- text, textbuf, textlen );
+ text, textbuf, textlen );
assert( rc != LDAP_TYPE_OR_VALUE_EXISTS );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
case LDAP_MOD_REPLACE:
#ifdef NEW_LOGGING
- LDAP_LOG( BACK_LDBM, DETAIL1, "ldbm_modify_internal: replace\n",0,0,0);
+ LDAP_LOG( BACK_LDBM, DETAIL1,
+ "ldbm_modify_internal: replace\n",0,0,0);
#else
- Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: replace\n", 0, 0, 0);
+ Debug(LDAP_DEBUG_ARGS,
+ "ldbm_modify_internal: replace\n", 0, 0, 0);
#endif
rc = modify_replace_values( e, mod, get_permissiveModify( op ),
- text, textbuf, textlen );
+ text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_modify_internal: softadd\n", 0, 0, 0 );
#else
- Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: softadd\n", 0, 0, 0);
+ Debug(LDAP_DEBUG_ARGS,
+ "ldbm_modify_internal: softadd\n", 0, 0, 0);
#endif
/* Avoid problems in index_add_mods()
mod->sm_op = LDAP_MOD_ADD;
rc = modify_add_values( e, mod, get_permissiveModify( op ),
- text, textbuf, textlen );
+ text, textbuf, textlen );
mod->sm_op = SLAP_MOD_SOFTADD;
if ( rc == LDAP_TYPE_OR_VALUE_EXISTS ) {
rc = LDAP_SUCCESS;
if( rc != LDAP_SUCCESS ) {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, INFO,
- "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
+ "ldbm_modify_internal: failed %d (%s)\n", rc, *text, 0 );
#else
Debug(LDAP_DEBUG_ARGS, "ldbm_modify_internal: %d %s\n",
rc, *text, 0);
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
- "Attribute index delete failure",
- 0, 0, 0 );
+ "ldbm_modify_internal: Attribute index delete failure\n",
+ 0, 0, 0 );
#endif
goto exit;
}
0, 0, 0 );
#else
Debug( LDAP_DEBUG_ANY,
- "Attribute index add failure",
- 0, 0, 0 );
+ "ldbm_modify_internal: Attribute index add failure\n",
+ 0, 0, 0 );
#endif
goto exit;
}
*/
if ( strcmp( ml->sml_desc->ad_type->sat_syntax->ssyn_oid,
SLAPD_DN_SYNTAX ) == 0 ) {
- ( void )ldap_dnattr_rewrite( &dc, ml->sml_bvalues );
+ ( void )ldap_dnattr_rewrite( &dc, ml->sml_values );
}
- if ( ml->sml_bvalues != NULL ){
- for (j = 0; ml->sml_bvalues[ j ].bv_val; j++);
- mods[ i ].mod_bvalues = (struct berval **)ch_malloc((j+1) *
+ if ( ml->sml_values != NULL ){
+ for (j = 0; ml->sml_values[ j ].bv_val; j++);
+ mods[ i ].mod_values = (struct berval **)ch_malloc((j+1) *
sizeof(struct berval *));
- for (j = 0; ml->sml_bvalues[ j ].bv_val; j++)
- mods[ i ].mod_bvalues[ j ] = &ml->sml_bvalues[j];
- mods[ i ].mod_bvalues[ j ] = NULL;
+ for (j = 0; ml->sml_values[ j ].bv_val; j++)
+ mods[ i ].mod_values[ j ] = &ml->sml_values[j];
+ mods[ i ].mod_values[ j ] = NULL;
} else {
- mods[ i ].mod_bvalues = NULL;
+ mods[ i ].mod_values = NULL;
}
i++;
}
if ( modv != NULL ) {
for ( i = 0; modv[ i ]; i++) {
- free( modv[ i ]->mod_bvalues );
+ free( modv[ i ]->mod_values );
}
}
free( mods );
*/
if ( is_at_operational( mod->sm_desc->ad_type ) ) {
( void ) attr_delete( &e->e_attrs, mod->sm_desc );
- rc = attr_merge( e, mod->sm_desc, mod->sm_bvalues,
- mod->sm_nvalues );
+ rc = attr_merge( e, mod->sm_desc, mod->sm_values, mod->sm_nvalues );
if ( rc != 0 ) {
rc = LDAP_OTHER;
break;
{
int i;
- for ( i = 0; mod->sm_bvalues && mod->sm_bvalues[i].bv_val != NULL; i++ ) {
+ for ( i = 0; mod->sm_values && mod->sm_values[i].bv_val != NULL; i++ ) {
int l;
- l = loglevel2int( &mod->sm_bvalues[i] );
+ l = loglevel2int( &mod->sm_values[i] );
if ( !l ) {
return LDAP_CONSTRAINT_VIOLATION;
}
}
assert( int_2_level[ l ].s.bv_len
- == mod->sm_bvalues[i].bv_len );
+ == mod->sm_values[i].bv_len );
- AC_MEMCPY( mod->sm_bvalues[i].bv_val,
+ AC_MEMCPY( mod->sm_values[i].bv_val,
int_2_level[ l ].s.bv_val,
int_2_level[ l ].s.bv_len );
return LDAP_INAPPROPRIATE_MATCHING;
}
- for ( i = 0; mod->sm_bvalues[i].bv_val != NULL; i++ ) {
+ for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
int rc;
int j;
const char *text = NULL;
rc = asserted_value_validate_normalize(
mod->sm_desc, mr, SLAP_MR_EQUALITY,
- &mod->sm_bvalues[i], &asserted, &text, NULL );
+ &mod->sm_values[i], &asserted, &text, NULL );
if ( rc != LDAP_SUCCESS ) {
return rc;
for ( j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
int match;
int rc = value_match( &match, mod->sm_desc, mr,
- 0,
- &a->a_vals[j], &asserted, &text );
+ 0, &a->a_vals[j], &asserted, &text );
if ( rc == LDAP_SUCCESS && match == 0 ) {
free( asserted.bv_val );
}
/* no - add them */
- rc = attr_merge( e, mod->sm_desc, mod->sm_bvalues, mod->sm_nvalues );
+ rc = attr_merge( e, mod->sm_desc, mod->sm_values, mod->sm_nvalues );
if ( rc != LDAP_SUCCESS ) {
/* this should return result of attr_mergeit */
return rc;
*newlevel &= ~nl;
/* delete the entire attribute */
- if ( mod->sm_bvalues == NULL ) {
+ if ( mod->sm_values == NULL ) {
int rc = attr_delete( &e->e_attrs, mod->sm_desc );
if ( rc ) {
}
/* find each value to delete */
- for ( i = 0; mod->sm_bvalues[i].bv_val != NULL; i++ ) {
+ for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
int rc;
const char *text = NULL;
rc = asserted_value_validate_normalize(
mod->sm_desc, mr, SLAP_MR_EQUALITY,
- &mod->sm_bvalues[i], &asserted, &text, NULL );
+ &mod->sm_values[i], &asserted, &text, NULL );
if( rc != LDAP_SUCCESS ) return rc;
return rc;
}
- if ( mod->sm_bvalues != NULL ) {
- rc = attr_merge( e, mod->sm_desc, mod->sm_bvalues,
- mod->sm_nvalues );
+ if ( mod->sm_values != NULL ) {
+ rc = attr_merge( e, mod->sm_desc, mod->sm_values, mod->sm_nvalues );
if ( rc != LDAP_SUCCESS ) {
return rc;
}
XPUSHs(sv_2mortal(newSVpv( mods->sm_desc->ad_cname.bv_val, 0 )));
for ( i = 0;
- mods->sm_bvalues != NULL && mods->sm_bvalues[i].bv_val != NULL;
+ mods->sm_values != NULL && mods->sm_values[i].bv_val != NULL;
i++ )
{
- XPUSHs(sv_2mortal(newSVpv( mods->sm_bvalues[i].bv_val, 0 )));
+ XPUSHs(sv_2mortal(newSVpv( mods->sm_values[i].bv_val, 0 )));
}
}
break;
}
- if( mod->sm_bvalues != NULL ) {
- for ( i = 0; mod->sm_bvalues[i].bv_val != NULL; i++ ) {
+ if( mod->sm_values != NULL ) {
+ for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
fprintf( wfp, "%s: %s\n", mod->sm_desc->ad_cname.bv_val,
- mod->sm_bvalues[i].bv_val /* binary! */ );
+ mod->sm_values[i].bv_val /* binary! */ );
}
}
"mappings for objectClass \"%s\"\n",
ad->ad_cname.bv_val, BACKSQL_OC_NAME( oc ), 0 );
- if ( backsql_attr_skip( ad, c_mod->sm_bvalues ) ) {
+ if ( backsql_attr_skip( ad, c_mod->sm_values ) ) {
continue;
}
Debug( LDAP_DEBUG_TRACE, " backsql_modify_internal(): "
"adding new values for attribute \"%s\"\n",
at->bam_ad->ad_cname.bv_val, 0, 0 );
- for ( i = 0, at_val = c_mod->sm_bvalues;
+ for ( i = 0, at_val = c_mod->sm_values;
at_val->bv_val != NULL;
i++, at_val++ ) {
if ( BACKSQL_IS_ADD( at->bam_expect_return ) ) {
break;
}
- if ( c_mod->sm_bvalues == NULL ) {
+ if ( c_mod->sm_values == NULL ) {
Debug( LDAP_DEBUG_TRACE,
" backsql_modify_internal(): "
"no values given to delete "
"deleting values for attribute \"%s\"\n",
at->bam_ad->ad_cname.bv_val, 0, 0 );
- for ( i = 0, at_val = c_mod->sm_bvalues;
+ for ( i = 0, at_val = c_mod->sm_values;
at_val->bv_val != NULL;
i++, at_val++ ) {
if ( BACKSQL_IS_DEL( at->bam_expect_return ) ) {
to a back-ldap (or back-meta) backend and allows search results from remote
servers to be cached locally. In both cases the overlays must provide a bit of
glue to swap in the appropriate be_private and bd_info pointers before invoking
-the attached backend, which can then be invoked as usual.
\ No newline at end of file
+the attached backend, which can then be invoked as usual.
+
+---
* in any subset, otherwise drop it.
*/
if ( ocs && ml->sml_desc == slap_schema.si_ad_objectClass
- && ml->sml_bvalues ) {
+ && ml->sml_values )
+ {
int i, first = 1;
if ( ocs == -1 ) ocs = 0;
- for ( i=0; ml->sml_bvalues[i].bv_val; i++ ) {
+ for ( i=0; ml->sml_values[i].bv_val; i++ ) {
int match = 0;
for ( an = ri->ri_attrs; an->an_name.bv_val; an++ ) {
if ( an->an_oc ) {
ocs = 1;
match |= an->an_oc_exclude;
- if ( ml->sml_bvalues[i].bv_len == an->an_name.bv_len
- && !strcasecmp(ml->sml_bvalues[i].bv_val,
+ if ( ml->sml_values[i].bv_len == an->an_name.bv_len
+ && !strcasecmp(ml->sml_values[i].bv_val,
an->an_name.bv_val ) ) {
match = !an->an_oc_exclude;
break;
dohdr = 0;
}
fprintf( fp, "%s: %s\n", did, type );
- if ( ml->sml_bvalues ) {
- print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_bvalues );
+ if ( ml->sml_values ) {
+ print_vals( fp, &ml->sml_desc->ad_cname, ml->sml_values );
}
fprintf( fp, "-\n" );
}
return LDAP_OBJECT_CLASS_VIOLATION;
}
- if( ocmod->sml_bvalues == NULL || ocmod->sml_bvalues[0].bv_val == NULL ) {
+ if( ocmod->sml_values == NULL || ocmod->sml_values[0].bv_val == NULL ) {
*text = "objectClass attribute has no values";
return LDAP_OBJECT_CLASS_VIOLATION;
}
- return structural_class( ocmod->sml_bvalues, sc, NULL,
+ return structural_class( ocmod->sml_values, sc, NULL,
text, textbuf, textlen );
}
AttributeDescription *sm_desc;
struct berval sm_type;
BerVarray sm_values;
-#define sm_bvalues sm_values
BerVarray sm_nvalues;
} Modification;
#define sml_op sml_mod.sm_op
#define sml_desc sml_mod.sm_desc
#define sml_type sml_mod.sm_type
-#define sml_bvalues sml_mod.sm_values
#define sml_values sml_mod.sm_values
#define sml_nvalues sml_mod.sm_nvalues
struct slap_mod_list *sml_next;
#define ml_op ml_mod.mod_op
#define ml_type ml_mod.mod_type
#define ml_values ml_mod.mod_values
-#define ml_bvalues ml_mod.mod_values
} LDAPModList;
/*
* being passed in may not have been allocated on the
* heap.
*/
- rc = bvptr2obj_copy( pMod->mod_bvalues, &bv );
+ rc = bvptr2obj_copy( pMod->mod_values, &bv );
if ( rc != LDAP_SUCCESS ) goto cleanup;
tmp.sml_type.bv_val = pMod->mod_type;
tmp.sml_type.bv_len = strlen( pMod->mod_type );
- tmp.sml_bvalues = bv;
+ tmp.sml_values = bv;
tmp.sml_nvalues = NULL;
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
mod->sml_next = NULL;
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
- mod->sml_bvalues = tmp.sml_bvalues;
+ mod->sml_values = tmp.sml_values;
mod->sml_nvalues = tmp.sml_nvalues;
*modtail = mod;
if ( rc != LDAP_SUCCESS ) goto cleanup;
tmp.sml_type.bv_val = pMod->mod_type;
tmp.sml_type.bv_len = strlen( pMod->mod_type );
- tmp.sml_bvalues = bv;
+ tmp.sml_values = bv;
tmp.sml_nvalues = NULL;
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
mod->sml_next = NULL;
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
- mod->sml_bvalues = tmp.sml_bvalues;
+ mod->sml_values = tmp.sml_values;
mod->sml_nvalues = tmp.sml_nvalues;
*modtail = mod;
* convert an array of pointers to bervals
* to an array of bervals
*/
- rs.sr_err = bvptr2obj_copy( pMod->mod_bvalues, &bv );
+ rs.sr_err = bvptr2obj_copy( pMod->mod_values, &bv );
if ( rs.sr_err != LDAP_SUCCESS )
goto cleanup;
tmp.sml_type.bv_val = pMod->mod_type;
tmp.sml_type.bv_len = strlen( pMod->mod_type );
- tmp.sml_bvalues = bv;
+ tmp.sml_values = bv;
tmp.sml_nvalues = NULL;
mod = (Modifications *)ch_malloc( sizeof(Modifications) );
mod->sml_next = NULL;
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
- mod->sml_bvalues = tmp.sml_bvalues;
+ mod->sml_values = tmp.sml_values;
mod->sml_nvalues = tmp.sml_nvalues;
} else {
rs.sr_err = values2obj_copy( pMod->mod_values, &bv );
goto cleanup;
tmp.sml_type.bv_val = pMod->mod_type;
tmp.sml_type.bv_len = strlen( pMod->mod_type );
- tmp.sml_bvalues = bv;
+ tmp.sml_values = bv;
tmp.sml_nvalues = NULL;
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
mod->sml_next = NULL;
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
- mod->sml_bvalues = tmp.sml_bvalues;
+ mod->sml_values = tmp.sml_values;
mod->sml_nvalues = tmp.sml_nvalues;
}
*modtail = mod;
switch( pMod->mod_op & LDAP_MOD_OP ) {
case LDAP_MOD_ADD:
- if ( mod->sml_bvalues == NULL ) {
+ if ( mod->sml_values == NULL ) {
rs.sr_err = LDAP_PROTOCOL_ERROR;
goto cleanup;
}
if ( vals == NULL ) {
/* Apparently vals can be NULL
- * FIXME: sm_bvalues = NULL ? */
- mod.sm_bvalues = (BerVarray)ch_malloc( sizeof(struct berval) );
- mod.sm_bvalues->bv_val = NULL;
+ * FIXME: sm_values = NULL ? */
+ mod.sm_values = (BerVarray)ch_malloc( sizeof(struct berval) );
+ mod.sm_values->bv_val = NULL;
} else {
- rc = bvptr2obj( vals, &mod.sm_bvalues );
+ rc = bvptr2obj( vals, &mod.sm_values );
if ( rc != LDAP_SUCCESS ) {
return LDAP_CONSTRAINT_VIOLATION;
}
rc = modify_add_values( e, &mod, 0, &text, textbuf, sizeof(textbuf) );
- ch_free( mod.sm_bvalues );
+ ch_free( mod.sm_values );
return (rc == LDAP_SUCCESS) ? LDAP_SUCCESS : LDAP_CONSTRAINT_VIOLATION;
#else
return attr_delete( &e->e_attrs, mod.sm_desc ) ? LDAP_OTHER : LDAP_SUCCESS;
}
- rc = bvptr2obj( vals, &mod.sm_bvalues );
+ rc = bvptr2obj( vals, &mod.sm_values );
if ( rc != LDAP_SUCCESS ) {
return LDAP_CONSTRAINT_VIOLATION;
}
rc = modify_delete_values( e, &mod, 0, &text, textbuf, sizeof(textbuf) );
- ch_free( mod.sm_bvalues );
+ ch_free( mod.sm_values );
return rc;
#else
mp = ml->sml_next;
/* just free the containing array */
- slapi_ch_free( (void **)&ml->sml_bvalues );
+ slapi_ch_free( (void **)&ml->sml_values );
slapi_ch_free( (void **)&ml );
}
modp->mod_type = ml->sml_type.bv_val;
ml->sml_type.bv_val = NULL;
- if ( ml->sml_bvalues != NULL ) {
- for( j = 0; ml->sml_bvalues[j].bv_val != NULL; j++ )
+ if ( ml->sml_values != NULL ) {
+ for( j = 0; ml->sml_values[j].bv_val != NULL; j++ )
;
- modp->mod_bvalues = (struct berval **)ch_malloc( (j + 1) *
+ modp->mod_values = (struct berval **)ch_malloc( (j + 1) *
sizeof(struct berval *) );
- for( j = 0; ml->sml_bvalues[j].bv_val != NULL; j++ ) {
+ for( j = 0; ml->sml_values[j].bv_val != NULL; j++ ) {
/* Take ownership of original values. */
- modp->mod_bvalues[j] = (struct berval *)ch_malloc( sizeof(struct berval) );
- modp->mod_bvalues[j]->bv_len = ml->sml_bvalues[j].bv_len;
- modp->mod_bvalues[j]->bv_val = ml->sml_bvalues[j].bv_val;
- ml->sml_bvalues[j].bv_len = 0;
- ml->sml_bvalues[j].bv_val = NULL;
+ modp->mod_values[j] = (struct berval *)ch_malloc( sizeof(struct berval) );
+ modp->mod_values[j]->bv_len = ml->sml_values[j].bv_len;
+ modp->mod_values[j]->bv_val = ml->sml_values[j].bv_val;
+ ml->sml_values[j].bv_len = 0;
+ ml->sml_values[j].bv_val = NULL;
}
- modp->mod_bvalues[j] = NULL;
+ modp->mod_values[j] = NULL;
} else {
- modp->mod_bvalues = NULL;
+ modp->mod_values = NULL;
}
i++;
}
mod->sml_next = NULL;
if ( (*modp)->mod_op & LDAP_MOD_BVALUES ) {
- for( i = 0, bvp = (*modp)->mod_bvalues; bvp != NULL && *bvp != NULL; bvp++, i++ )
+ for( i = 0, bvp = (*modp)->mod_values; bvp != NULL && *bvp != NULL; bvp++, i++ )
;
} else {
for( i = 0, p = (*modp)->mod_values; p != NULL && *p != NULL; p++, i++ )
}
if ( i == 0 ) {
- mod->sml_bvalues = NULL;
+ mod->sml_values = NULL;
} else {
- mod->sml_bvalues = (BerVarray) ch_malloc( (i + 1) * sizeof(struct berval) );
+ mod->sml_values = (BerVarray) ch_malloc( (i + 1) * sizeof(struct berval) );
/* NB: This implicitly trusts a plugin to return valid modifications. */
if ( (*modp)->mod_op & LDAP_MOD_BVALUES ) {
- for( i = 0, bvp = (*modp)->mod_bvalues; bvp != NULL && *bvp != NULL; bvp++, i++ ) {
- mod->sml_bvalues[i].bv_val = (*bvp)->bv_val;
- mod->sml_bvalues[i].bv_len = (*bvp)->bv_len;
+ for( i = 0, bvp = (*modp)->mod_values; bvp != NULL && *bvp != NULL; bvp++, i++ ) {
+ mod->sml_values[i].bv_val = (*bvp)->bv_val;
+ mod->sml_values[i].bv_len = (*bvp)->bv_len;
}
} else {
for( i = 0, p = (*modp)->mod_values; p != NULL && *p != NULL; p++, i++ ) {
- mod->sml_bvalues[i].bv_val = *p;
- mod->sml_bvalues[i].bv_len = strlen( *p );
+ mod->sml_values[i].bv_val = *p;
+ mod->sml_values[i].bv_len = strlen( *p );
}
}
- mod->sml_bvalues[i].bv_val = NULL;
- mod->sml_bvalues[i].bv_len = 0;
+ mod->sml_values[i].bv_val = NULL;
+ mod->sml_values[i].bv_len = 0;
}
mod->sml_nvalues = NULL;
* Modification list. Do free the containing array.
*/
if ( mods[i]->mod_op & LDAP_MOD_BVALUES ) {
- for ( j = 0; mods[i]->mod_bvalues != NULL && mods[i]->mod_bvalues[j] != NULL; j++ ) {
- ch_free( mods[i]->mod_bvalues[j] );
+ for ( j = 0; mods[i]->mod_values != NULL && mods[i]->mod_values[j] != NULL; j++ ) {
+ ch_free( mods[i]->mod_values[j] );
}
- ch_free( mods[i]->mod_bvalues );
+ ch_free( mods[i]->mod_values );
} else {
ch_free( mods[i]->mod_values );
}
mod->sml_next = NULL;
mod->sml_desc = NULL;
mod->sml_type = tmp.sml_type;
- mod->sml_bvalues = tmp.sml_bvalues;
+ mod->sml_values = tmp.sml_values;
mod->sml_nvalues = NULL;
*modtail = mod;
mod->sml_op = LDAP_MOD_REPLACE;
mod->sml_desc = slap_schema.si_ad_entryUUID;
mod->sml_type = mod->sml_desc->ad_cname;
- ber_bvarray_add( &mod->sml_bvalues, &uuid_bv );
+ ber_bvarray_add( &mod->sml_values, &uuid_bv );
modtail->sml_next = mod;
op->o_tag = LDAP_REQ_MODIFY;
mod->sml_op = LDAP_MOD_REPLACE;
mod->sml_desc = slap_schema.si_ad_objectClass;
mod->sml_type = mod->sml_desc->ad_cname;
- mod->sml_bvalues = &gcbva[0];
+ mod->sml_values = &gcbva[0];
*modtail = mod;
modtail = &mod->sml_next;
mod->sml_op = LDAP_MOD_REPLACE;
mod->sml_desc = slap_schema.si_ad_structuralObjectClass;
mod->sml_type = mod->sml_desc->ad_cname;
- mod->sml_bvalues = &gcbva[1];
+ mod->sml_values = &gcbva[1];
*modtail = mod;
modtail = &mod->sml_next;
mod->sml_op = LDAP_MOD_REPLACE;
mod->sml_desc = slap_schema.si_ad_objectClass;
mod->sml_type = mod->sml_desc->ad_cname;
- mod->sml_bvalues = ocbva;
+ mod->sml_values = ocbva;
*modtail = mod;
modtail = &mod->sml_next;
mod->sml_op = LDAP_MOD_REPLACE;
mod->sml_desc = slap_schema.si_ad_cn;
mod->sml_type = mod->sml_desc->ad_cname;
- mod->sml_bvalues = cnbva;
+ mod->sml_values = cnbva;
*modtail = mod;
modtail = &mod->sml_next;
mod->sml_op = LDAP_MOD_REPLACE;
mod->sml_desc = slap_schema.si_ad_syncreplCookie;
mod->sml_type = mod->sml_desc->ad_cname;
- mod->sml_bvalues = scbva;
+ mod->sml_values = scbva;
*modtail = mod;
modtail = &mod->sml_next;
mod->sml_op = LDAP_MOD_REPLACE;
mod->sml_desc = slap_schema.si_ad_subtreeSpecification;
mod->sml_type = mod->sml_desc->ad_cname;
- mod->sml_bvalues = ssbva;
+ mod->sml_values = ssbva;
*modtail = mod;
modtail = &mod->sml_next;