goto done;
}
- rs->sr_err = slap_mods_check( modlist, &rs->sr_text,
+ rs->sr_err = slap_mods_check( op, modlist, &rs->sr_text,
textbuf, textlen, NULL );
if ( rs->sr_err != LDAP_SUCCESS ) {
goto done;
}
-#if 0 /* This is a no-op since *modtail is NULL */
- rs->sr_err = slap_mods2entry( *modtail, &op->ora_e,
- 0, 0, &rs->sr_text, textbuf, textlen );
- if ( rs->sr_err != LDAP_SUCCESS ) {
- send_ldap_result( op, rs );
- goto done;
- }
-#endif
-
cb.sc_next = op->o_callback;
op->o_callback = &cb;
}
#endif
}
-#if 0 /* checked for duplicates in slap_mods_check */
- if( mods->sml_values[1].bv_val != NULL ) {
- /* check for duplicates */
- int i, j, rc, match;
- MatchingRule *mr = mods->sml_desc->ad_type->sat_equality;
-
- for ( i = 1; mods->sml_values[i].bv_val != NULL; i++ ) {
- /* test asserted values against themselves */
- for( j = 0; j < i; j++ ) {
- rc = ordered_value_match( &match, mods->sml_desc, mr,
- SLAP_MR_EQUALITY
- | SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX
- | SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH
- | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
- mods->sml_nvalues
- ? &mods->sml_nvalues[i]
- : &mods->sml_values[i],
- mods->sml_nvalues
- ? &mods->sml_nvalues[j]
- : &mods->sml_values[j],
- text );
-
- if ( rc == LDAP_SUCCESS && match == 0 ) {
- /* value exists already */
- snprintf( textbuf, textlen,
- "%s: value #%d provided more than once",
- mods->sml_desc->ad_cname.bv_val, j );
- *text = textbuf;
- return LDAP_TYPE_OR_VALUE_EXISTS;
-
- } else if ( rc != LDAP_SUCCESS ) {
- return rc;
- }
- }
- }
- }
-#endif
-
attr = attr_alloc( mods->sml_desc );
/* move values to attr structure */
goto cleanup;
}
- rs->sr_err = slap_mods_check( modlist,
+ rs->sr_err = slap_mods_check( op, modlist,
&rs->sr_text, textbuf, textlen, NULL );
if ( rs->sr_err != LDAP_SUCCESS ) {
* Do basic attribute type checking and syntax validation.
*/
int slap_mods_check(
+ Operation *op,
Modifications *ml,
const char **text,
char *textbuf,
size_t textlen );
LDAP_SLAPD_F( int ) slap_mods_check(
+ Operation *op,
Modifications *ml,
const char **text,
char *textbuf, size_t textlen, void *ctx );
/* slapi_utils.c */
LDAP_SLAPI_F (LDAPMod **) slapi_int_modifications2ldapmods LDAP_P(( Modifications * ));
-LDAP_SLAPI_F (Modifications *) slapi_int_ldapmods2modifications LDAP_P(( LDAPMod ** ));
+LDAP_SLAPI_F (Modifications *) slapi_int_ldapmods2modifications LDAP_P(( Operation *op, LDAPMod ** ));
LDAP_SLAPI_F (int) slapi_int_count_controls LDAP_P(( LDAPControl **ctrls ));
LDAP_SLAPI_F (char **) slapi_get_supported_extended_ops LDAP_P((void));
LDAP_SLAPI_F (int) slapi_int_access_allowed LDAP_P((Operation *op, Entry *entry, AttributeDescription *desc, struct berval *val, slap_access_t access, AccessControlState *state ));
assert( pb->pb_op->ora_modlist != NULL );
}
- rs->sr_err = slap_mods_check( pb->pb_op->ora_modlist, &rs->sr_text,
+ rs->sr_err = slap_mods_check( pb->pb_op, pb->pb_op->ora_modlist, &rs->sr_text,
pb->pb_textbuf, sizeof( pb->pb_textbuf ), NULL );
if ( rs->sr_err != LDAP_SUCCESS ) {
goto cleanup;
goto cleanup;
}
- rs->sr_err = slap_mods_check( pb->pb_op->orm_modlist,
+ rs->sr_err = slap_mods_check( pb->pb_op, pb->pb_op->orm_modlist,
&rs->sr_text, pb->pb_textbuf, sizeof( pb->pb_textbuf ), NULL );
if ( rs->sr_err != LDAP_SUCCESS ) {
goto cleanup;
break;
}
- newmods = slapi_int_ldapmods2modifications( (LDAPMod **)value );
+ newmods = slapi_int_ldapmods2modifications( pb->pb_op, (LDAPMod **)value );
if ( newmods != NULL ) {
slap_mods_free( *mlp, 1 );
*mlp = newmods;
if ( pb == NULL || pb->pb_op == NULL )
return LDAP_PARAM_ERROR;
- ml = slapi_int_ldapmods2modifications( mods );
+ ml = slapi_int_ldapmods2modifications( pb->pb_op, mods );
if ( ml == NULL ) {
return LDAP_OTHER;
}
* before prettying (and we can't easily get out of calling
* slap_mods_check() because we need normalized values).
*/
-Modifications *slapi_int_ldapmods2modifications ( LDAPMod **mods )
+Modifications *slapi_int_ldapmods2modifications ( Operation *op, LDAPMod **mods )
{
Modifications *modlist = NULL, **modtail;
LDAPMod **modp;
modtail = &mod->sml_next;
}
- if ( slap_mods_check( modlist, &text, textbuf, sizeof( textbuf ), NULL ) != LDAP_SUCCESS ) {
+ if ( slap_mods_check( op, modlist, &text, textbuf, sizeof( textbuf ), NULL ) != LDAP_SUCCESS ) {
slap_mods_free( modlist, 1 );
modlist = NULL;
}
op->o_bd = be = si->si_be;
op->o_dn = op->o_bd->be_rootdn;
op->o_ndn = op->o_bd->be_rootndn;
+ if ( !si->si_schemachecking )
+ op->o_no_schema_check = 1;
/* Establish session, do search */
if ( !si->si_ld ) {
/* If we didn't get required data, bail */
if ( !modlist ) goto done;
- rc = slap_mods_check( modlist, &text, txtbuf, textlen, NULL );
+ rc = slap_mods_check( op, modlist, &text, txtbuf, textlen, NULL );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_op: rid %03d "
goto done;
}
- rc = slap_mods_check( *modlist, &text, txtbuf, textlen, NULL );
+ rc = slap_mods_check( op, *modlist, &text, txtbuf, textlen, NULL );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "syncrepl_message_to_entry: rid %03d mods check (%s)\n",