From f757db004cca62a1cd29f4e4959bad9c5577fcc3 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 10 Jan 2002 20:12:25 +0000 Subject: [PATCH] fix for backend-dependent schema check --- servers/slapd/back-monitor/back-monitor.h | 1 + servers/slapd/back-monitor/init.c | 7 +++---- servers/slapd/back-monitor/log.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/servers/slapd/back-monitor/back-monitor.h b/servers/slapd/back-monitor/back-monitor.h index b868c3541c..ed1699a0cd 100644 --- a/servers/slapd/back-monitor/back-monitor.h +++ b/servers/slapd/back-monitor/back-monitor.h @@ -190,6 +190,7 @@ struct monitorsubsys { extern struct monitorsubsys monitor_subsys[]; extern AttributeDescription *monitor_ad_desc; +extern BackendDB *be_monitor; /* * cache diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 56b3cb38b3..81daaf29d8 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -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; diff --git a/servers/slapd/back-monitor/log.c b/servers/slapd/back-monitor/log.c index 8cc3281b6f..fe5a081932 100644 --- a/servers/slapd/back-monitor/log.c +++ b/servers/slapd/back-monitor/log.c @@ -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; } -- 2.39.5