]> git.sur5r.net Git - openldap/commitdiff
fix for backend-dependent schema check
authorPierangelo Masarati <ando@openldap.org>
Thu, 10 Jan 2002 20:12:25 +0000 (20:12 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 10 Jan 2002 20:12:25 +0000 (20:12 +0000)
servers/slapd/back-monitor/back-monitor.h
servers/slapd/back-monitor/init.c
servers/slapd/back-monitor/log.c

index b868c3541c069f465427ff5430dc251a7b595fb7..ed1699a0cda5c480aa9b9af0dfff1f501c581825 100644 (file)
@@ -190,6 +190,7 @@ struct monitorsubsys {
 extern struct monitorsubsys monitor_subsys[];
 
 extern AttributeDescription *monitor_ad_desc;
+extern BackendDB *be_monitor;
 
 /*
  * cache
index 56b3cb38b399825f8f6c7b739b1910dc10283a95..81daaf29d820af8c6f8870fe5ee3bc79e4c0fad5 100644 (file)
@@ -43,6 +43,7 @@
  * used by many functions to add description to entries
  */
 AttributeDescription *monitor_ad_desc = NULL;
+BackendDB *be_monitor = NULL;
 
 /*
  * subsystem data
@@ -224,9 +225,7 @@ monitor_back_db_init(
        /*
         * database monitor can be defined once only
         */
-       static int              monitor_defined = 0;
-
-       if ( monitor_defined ) {
+       if ( be_monitor ) {
 #ifdef NEW_LOGGING
                LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
                        "only one monitor backend is allowed\n" ));
@@ -237,7 +236,7 @@ monitor_back_db_init(
 #endif
                return( -1 );
        }
-       monitor_defined++;
+       be_monitor = be;
 
        ndn = NULL;
        dn.bv_val = SLAPD_MONITOR_DN;
index 8cc3281b6f3b4d1a2e4d396f9ad0b425a75d4434..fe5a0819327fae89b8e79fb13aef7c89488113cc 100644 (file)
@@ -206,8 +206,8 @@ monitor_subsys_log_modify(
 #endif
 
                /* check that the entry still obeys the schema */
-               rc = entry_schema_check( NULL, e, save_attrs, &text, textbuf
-                               sizeof( textbuf ) );
+               rc = entry_schema_check( be_monitor, e, save_attrs
+                               &text, textbuf, sizeof( textbuf ) );
                if ( rc != LDAP_SUCCESS ) {
                        goto cleanup;
                }