Commit ae50b178 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

ITS#5186 check for multiple suffixes at config time, not open time

parent f39ac87b
......@@ -4,6 +4,7 @@ OpenLDAP 2.4.7 Engineering
Fixed slapd paged results control handling (ITS#5191)
Fixed slapd sasl-host parsing (ITS#5209)
Fixed slapd filter normalization (ITS#5212)
Fixed slapd multiple sufix checking (ITS#5186)
Fixed slapo-syncprov refresh and persist cookie sending (ITS#5210)
Fixed slapo-syncprov ignore invalid cookies (ITS#5211)
Documentation
......
......@@ -87,6 +87,10 @@ bdb_db_init( BackendDB *be, ConfigReply *cr )
be->be_private = bdb;
be->be_cf_ocs = be->bd_info->bi_cf_ocs;
#ifndef BDB_MULTIPLE_SUFFIXES
SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_ONE_SUFFIX;
#endif
rc = bdb_monitor_db_init( be );
return rc;
......@@ -119,19 +123,6 @@ bdb_db_open( BackendDB *be, ConfigReply *cr )
LDAP_XSTRING(bdb_db_open) ": \"%s\"\n",
be->be_suffix[0].bv_val, 0, 0 );
#ifndef BDB_MULTIPLE_SUFFIXES
if ( be->be_suffix[1].bv_val ) {
if (cr) {
snprintf(cr->msg, sizeof(cr->msg),
"database \"%s\": only one suffix allowed.",
be->be_suffix[0].bv_val);
Debug( LDAP_DEBUG_ANY,
LDAP_XSTRING(bdb_db_open) ": %s\n", cr->msg, 0, 0 );
}
return -1;
}
#endif
/* Check existence of dbenv_home. Any error means trouble */
rc = stat( bdb->bi_dbenv_home, &stat1 );
if( rc != 0 ) {
......
......@@ -2244,8 +2244,17 @@ config_suffix(ConfigArgs *c)
}
#endif
if (SLAP_DB_ONE_SUFFIX( c->be ) && c->be->be_suffix ) {
snprintf( c->cr_msg, sizeof( c->cr_msg ), "<%s> Only one suffix is allowed on this %s backend",
c->argv[0], c->be->bd_info->bi_type );
Debug(LDAP_DEBUG_ANY, "%s: %s\n",
c->log, c->cr_msg, 0);
return(1);
}
pdn = c->value_dn;
ndn = c->value_ndn;
if (SLAP_DBHIDDEN( c->be ))
tbe = NULL;
else
......
......@@ -1764,6 +1764,7 @@ struct BackendDB {
#define SLAP_DBFLAG_NOLASTMOD 0x0001U
#define SLAP_DBFLAG_NO_SCHEMA_CHECK 0x0002U
#define SLAP_DBFLAG_HIDDEN 0x0004U
#define SLAP_DBFLAG_ONE_SUFFIX 0x0008U
#define SLAP_DBFLAG_GLUE_INSTANCE 0x0010U /* a glue backend */
#define SLAP_DBFLAG_GLUE_SUBORDINATE 0x0020U /* child of a glue hierarchy */
#define SLAP_DBFLAG_GLUE_LINKED 0x0040U /* child is connected to parent */
......@@ -1781,6 +1782,7 @@ struct BackendDB {
#define SLAP_NOLASTMOD(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NOLASTMOD)
#define SLAP_LASTMOD(be) (!SLAP_NOLASTMOD(be))
#define SLAP_DBHIDDEN(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_HIDDEN)
#define SLAP_DB_ONE_SUFFIX(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_ONE_SUFFIX)
#define SLAP_ISOVERLAY(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_OVERLAY)
#define SLAP_ISGLOBALOVERLAY(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_GLOBAL_OVERLAY)
#define SLAP_DBMONITORING(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_MONITORING)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment