From: Kurt Zeilenga Date: Thu, 10 Jan 2002 19:37:03 +0000 (+0000) Subject: Add Backend argument to entry_schema_check() to support system schema X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~205 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c816ebc225a32726067569269a8f53702e2b996b;p=openldap Add Backend argument to entry_schema_check() to support system schema checks (in addition to user application schema checks). --- diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 40013ab606..6be4202c70 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -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", diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 336c291056..435ae651b8 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -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; diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index f176f81666..e663c8645c 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -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); diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 73fa87ea1d..6e263639d6 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -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; diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index 1c312540e6..0e3d18f9e7 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -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; diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index edd4ae31f7..1cbf8fc314 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -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 ); diff --git a/servers/slapd/schema_check.c b/servers/slapd/schema_check.c index 81ef656276..4e44ffaafe 100644 --- a/servers/slapd/schema_check.c +++ b/servers/slapd/schema_check.c @@ -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 ) { diff --git a/servers/slapd/tools/slapadd.c b/servers/slapd/tools/slapadd.c index e030ae8d5f..e428b62001 100644 --- a/servers/slapd/tools/slapadd.c +++ b/servers/slapd/tools/slapadd.c @@ -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",