mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
improve diagnostics when configuring suffix for special databases
This commit is contained in:
parent
a238b4ffd4
commit
7236c4b223
@ -1546,13 +1546,29 @@ config_overlay(ConfigArgs *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
config_suffix(ConfigArgs *c) {
|
config_suffix(ConfigArgs *c)
|
||||||
|
{
|
||||||
Backend *tbe;
|
Backend *tbe;
|
||||||
struct berval pdn, ndn;
|
struct berval pdn, ndn;
|
||||||
int rc;
|
int rc;
|
||||||
|
char *notallowed = NULL;
|
||||||
|
|
||||||
if (c->be == frontendDB || SLAP_MONITOR(c->be) ||
|
if ( c->be == frontendDB ) {
|
||||||
SLAP_CONFIG(c->be)) return 1;
|
notallowed = "frontend";
|
||||||
|
|
||||||
|
} else if ( SLAP_MONITOR(c->be) ) {
|
||||||
|
notallowed = "monitor";
|
||||||
|
|
||||||
|
} else if ( SLAP_CONFIG(c->be) ) {
|
||||||
|
notallowed = "config";
|
||||||
|
}
|
||||||
|
|
||||||
|
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->op == SLAP_CONFIG_EMIT) {
|
||||||
if ( c->be->be_suffix == NULL
|
if ( c->be->be_suffix == NULL
|
||||||
@ -1581,6 +1597,7 @@ config_suffix(ConfigArgs *c) {
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SLAPD_MONITOR_DN
|
#ifdef SLAPD_MONITOR_DN
|
||||||
if(!strcasecmp(c->argv[1], SLAPD_MONITOR_DN)) {
|
if(!strcasecmp(c->argv[1], SLAPD_MONITOR_DN)) {
|
||||||
sprintf( c->msg, "<%s> DN is reserved for monitoring slapd",
|
sprintf( c->msg, "<%s> DN is reserved for monitoring slapd",
|
||||||
|
Loading…
Reference in New Issue
Block a user