Add o_no_schema_check to operation structure

entry_schema_check() nows takes Operation instead of Backend as first
argument, allows it to check o_no_schema_check
This commit is contained in:
Luke Howard 2005-08-01 15:26:13 +00:00
parent 381a4d62c5
commit 12d006d17d
14 changed files with 32 additions and 18 deletions

View file

@ -52,7 +52,7 @@ bdb_add(Operation *op, SlapReply *rs )
ctrls[num_ctrls] = 0;
/* check entry's schema */
rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL,
rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL,
get_manageDIT(op), &rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,

View file

@ -196,7 +196,7 @@ int bdb_modify_internal(
}
/* check that the entry still obeys the schema */
rc = entry_schema_check( op->o_bd, e, save_attrs, get_manageDIT(op),
rc = entry_schema_check( op, e, save_attrs, get_manageDIT(op),
text, textbuf, textlen );
if ( rc != LDAP_SUCCESS || op->o_noop ) {
attrs_free( e->e_attrs );

View file

@ -45,7 +45,7 @@ ldbm_back_add(
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n",
op->o_req_dn.bv_val, 0, 0);
rs->sr_err = entry_schema_check( op->o_bd, op->oq_add.rs_e, NULL,
rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL,
get_manageDIT(op), &rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {

View file

@ -164,7 +164,7 @@ int ldbm_modify_internal(
}
/* check that the entry still obeys the schema */
rc = entry_schema_check( op->o_bd, e, save_attrs, get_manageDIT(op),
rc = entry_schema_check( op, e, save_attrs, get_manageDIT(op),
text, textbuf, textlen );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "entry failed schema check: %s\n",

View file

@ -197,7 +197,7 @@ monitor_subsys_log_modify(
}
/* check that the entry still obeys the schema */
rc = entry_schema_check( be_monitor, e, save_attrs, 0,
rc = entry_schema_check( op, e, save_attrs, 0,
&text, textbuf, sizeof( textbuf ) );
if ( rc != LDAP_SUCCESS ) {
rs->sr_err = rc;

View file

@ -956,7 +956,7 @@ backsql_add( Operation *op, SlapReply *rs )
if ( BACKSQL_CHECK_SCHEMA( bi ) ) {
char textbuf[ SLAP_TEXT_BUFLEN ] = { '\0' };
rs->sr_err = entry_schema_check( op->o_bd, op->ora_e, NULL, 0,
rs->sr_err = entry_schema_check( op, op->ora_e, NULL, 0,
&rs->sr_text, textbuf, sizeof( textbuf ) );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "

View file

@ -151,7 +151,7 @@ backsql_modify( Operation *op, SlapReply *rs )
goto do_transact;
}
rs->sr_err = entry_schema_check( op->o_bd, &m, NULL, 0,
rs->sr_err = entry_schema_check( op, &m, NULL, 0,
&rs->sr_text, textbuf, sizeof( textbuf ) );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "

View file

@ -495,7 +495,7 @@ backsql_modrdn( Operation *op, SlapReply *rs )
e_id = bsi.bsi_base_id;
rs->sr_err = entry_schema_check( op->o_bd, &r, NULL, 0,
rs->sr_err = entry_schema_check( op, &r, NULL, 0,
&rs->sr_text, textbuf, sizeof( textbuf ) );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE, " backsql_add(\"%s\"): "

View file

@ -3500,7 +3500,7 @@ config_modify_internal( CfEntryInfo *ce, Operation *op, SlapReply *rs,
if(rc == LDAP_SUCCESS) {
/* check that the entry still obeys the schema */
rc = entry_schema_check(op->o_bd, e, NULL, 0,
rc = entry_schema_check(op, e, NULL, 0,
&rs->sr_text, ca->msg, sizeof(ca->msg) );
}
if ( rc == LDAP_SUCCESS ) {

View file

@ -1357,7 +1357,7 @@ LDAP_SLAPD_F( int ) structural_class(
char *textbuf, size_t textlen );
LDAP_SLAPD_F( int ) entry_schema_check(
Backend *be,
Operation *op,
Entry *e,
Attribute *attrs,
int manage,

View file

@ -43,7 +43,7 @@ static int entry_naming_check(
int
entry_schema_check(
Backend *be,
Operation *op,
Entry *e,
Attribute *oldattrs,
int manage,
@ -64,7 +64,11 @@ entry_schema_check(
int subentry = is_entry_subentry( e );
int collectiveSubentry = 0;
if ( SLAP_NO_SCHEMA_CHECK( be )) {
if ( SLAP_NO_SCHEMA_CHECK( op->o_bd )) {
return LDAP_SUCCESS;
}
if ( get_no_schema_check( op ) ) {
return LDAP_SUCCESS;
}
@ -84,7 +88,7 @@ entry_schema_check(
if( a->a_desc->ad_type->sat_check ) {
int rc = (a->a_desc->ad_type->sat_check)(
be, e, a, text, textbuf, textlen );
op->o_bd, e, a, text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
return rc;
}
@ -308,7 +312,7 @@ entry_schema_check(
}
if ( oc->soc_check ) {
int rc = (oc->soc_check)( be, e, oc,
int rc = (oc->soc_check)( op->o_bd, e, oc,
text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
return rc;

View file

@ -2395,6 +2395,8 @@ typedef struct slap_op {
char o_nocaching;
char o_delete_glue_parent;
char o_no_schema_check;
#define get_no_schema_check(op) ((op)->o_no_schema_check)
#define SLAP_CONTROL_NONE 0
#define SLAP_CONTROL_IGNORED 1

View file

@ -64,8 +64,14 @@ slapadd( int argc, char **argv )
int ret;
struct berval bvtext;
int checkvals;
char opbuf[OPERATION_BUFFER_SIZE];
Operation *op;
slap_tool_init( progname, SLAPADD, argc, argv );
memset( opbuf, 0, sizeof(opbuf) );
op = (Operation *)opbuf;
if( !be->be_entry_open ||
!be->be_entry_close ||
!be->be_entry_put )
@ -181,7 +187,9 @@ slapadd( int argc, char **argv )
}
/* check schema */
rc = entry_schema_check( be, e, NULL, manage,
op->o_bd = be;
rc = entry_schema_check( op, e, NULL, manage,
&text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {

View file

@ -27,7 +27,7 @@ LDAP_BEGIN_DECL
/* slapi_utils.c */
LDAP_SLAPI_F (LDAPMod **) slapi_int_modifications2ldapmods LDAP_P(( Modifications **, void *ctx ));
LDAP_SLAPI_F (Modifications *) slapi_int_ldapmods2modifications LDAP_P(( LDAPMod **, int dup, void *ctx ));
LDAP_SLAPI_F (Modifications *) slapi_int_ldapmods2modifications LDAP_P(( LDAPMod **, void *ctx ));
LDAP_SLAPI_F (void) slapi_int_free_ldapmods LDAP_P(( 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));
@ -41,7 +41,6 @@ LDAP_SLAPI_F (void) slapi_int_connection_done_pb LDAP_P(( Slapi_PBlock *pb ));
/* slapi_pblock.c */
LDAP_SLAPI_F (int) slapi_pblock_delete_param LDAP_P(( Slapi_PBlock *p, int param ));
LDAP_SLAPI_F (void) slapi_pblock_clear LDAP_P(( Slapi_PBlock *pb ));
LDAP_SLAPI_F (void) slapi_int_mods_free( Modifications *ml );
LDAP_SLAPI_F (int) slapi_int_pblock_get_first LDAP_P(( Backend *be, Slapi_PBlock **pb ));
LDAP_SLAPI_F (int) slapi_int_pblock_get_next LDAP_P(( Slapi_PBlock **pb ));
@ -84,7 +83,8 @@ LDAP_SLAPI_F (int) slapi_int_create_object_extensions LDAP_P((int objecttype, vo
LDAP_SLAPI_F (int) slapi_int_clear_object_extensions LDAP_P((int objecttype, void *object));
/* slapi_overlay.c */
LDAP_SLAPI_F (int) slapi_int_overlay_init LDAP_P((void));
LDAP_SLAPI_F (int) slapi_over_is_inst LDAP_P((BackendDB *));
LDAP_SLAPI_F (int) slapi_over_config LDAP_P((BackendDB *));
LDAP_END_DECL