mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-03 21:50:49 -05:00
Add Backend argument to entry_schema_check() to support system schema
checks (in addition to user application schema checks).
This commit is contained in:
parent
f5bfb64f07
commit
c816ebc225
8 changed files with 10 additions and 8 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue