Add Backend argument to entry_schema_check() to support system schema

checks (in addition to user application schema checks).
This commit is contained in:
Kurt Zeilenga 2002-01-10 19:37:03 +00:00
parent f5bfb64f07
commit c816ebc225
8 changed files with 10 additions and 8 deletions

View file

@ -35,7 +35,7 @@ bdb_add(
Debug(LDAP_DEBUG_ARGS, "==> bdb_add: %s\n", e->e_dn, 0, 0);
/* check entry's schema */
rc = entry_schema_check( e, NULL, &text, textbuf, textlen );
rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
"bdb_add: entry failed schema check: %s (%d)\n",

View file

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

View file

@ -54,7 +54,7 @@ ldbm_back_add(
return( -1 );
}
rc = entry_schema_check( e, NULL, &text, textbuf, textlen );
rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
if ( rc != LDAP_SUCCESS ) {
ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);

View file

@ -202,7 +202,7 @@ int ldbm_modify_internal(
ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
/* check that the entry still obeys the schema */
rc = entry_schema_check( e, save_attrs, text, textbuf, textlen );
rc = entry_schema_check( be, e, save_attrs, text, textbuf, textlen );
if ( rc != LDAP_SUCCESS ) {
attrs_free( e->e_attrs );
e->e_attrs = save_attrs;

View file

@ -206,7 +206,7 @@ monitor_subsys_log_modify(
#endif
/* check that the entry still obeys the schema */
rc = entry_schema_check( e, save_attrs, &text, textbuf,
rc = entry_schema_check( be, e, save_attrs, &text, textbuf,
sizeof( textbuf ) );
if ( rc != LDAP_SUCCESS ) {
goto cleanup;

View file

@ -827,7 +827,7 @@ LDAP_SLAPD_F( int ) structural_class(
char *textbuf, size_t textlen );
LDAP_SLAPD_F( int ) entry_schema_check(
Entry *e, Attribute *attrs,
Backend *be, Entry *e, Attribute *attrs,
const char** text,
char *textbuf, size_t textlen );

View file

@ -30,7 +30,9 @@ static char * oc_check_required(
int
entry_schema_check(
Entry *e, Attribute *oldattrs,
Backend *be,
Entry *e,
Attribute *oldattrs,
const char** text,
char *textbuf, size_t textlen )
{

View file

@ -134,7 +134,7 @@ main( int argc, char **argv )
if( global_schemacheck ) {
/* check schema */
rc = entry_schema_check( e, NULL, &text, textbuf, textlen );
rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: dn=\"%s\" (line=%d): %s\n",