From: Pierangelo Masarati Date: Fri, 15 Jul 2005 16:21:15 +0000 (+0000) Subject: improve diagnostics when configuring suffix for special databases X-Git-Tag: OPENLDAP_AC_BP~394 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7236c4b2233b329064194b1f343561c86049ddef;p=openldap improve diagnostics when configuring suffix for special databases --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index b7e919b72f..36b5d6e832 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -1546,13 +1546,29 @@ config_overlay(ConfigArgs *c) { } static int -config_suffix(ConfigArgs *c) { +config_suffix(ConfigArgs *c) +{ Backend *tbe; struct berval pdn, ndn; int rc; + char *notallowed = NULL; + + if ( c->be == frontendDB ) { + notallowed = "frontend"; + + } else if ( SLAP_MONITOR(c->be) ) { + notallowed = "monitor"; + + } else if ( SLAP_CONFIG(c->be) ) { + notallowed = "config"; + } - if (c->be == frontendDB || SLAP_MONITOR(c->be) || - SLAP_CONFIG(c->be)) return 1; + if ( notallowed != NULL ) { + Debug(LDAP_DEBUG_ANY, + "%s: suffix <%s> not allowed in %s database.\n", + c->log, c->value_dn.bv_val, notallowed ); + return 1; + } if (c->op == SLAP_CONFIG_EMIT) { if ( c->be->be_suffix == NULL @@ -1581,6 +1597,7 @@ config_suffix(ConfigArgs *c) { } return 0; } + #ifdef SLAPD_MONITOR_DN if(!strcasecmp(c->argv[1], SLAPD_MONITOR_DN)) { sprintf( c->msg, "<%s> DN is reserved for monitoring slapd",