mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 16:49:39 -05:00
don't segfault if a database doesn't have the suffix
This commit is contained in:
parent
04096a3cca
commit
1a9bc6655d
3 changed files with 17 additions and 2 deletions
|
|
@ -283,11 +283,13 @@ int backend_startup(Backend *be)
|
|||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( BACKEND, DETAIL1, "backend_startup: starting \"%s\"\n",
|
||||
be->be_suffix[0].bv_val, 0, 0 );
|
||||
be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)",
|
||||
0, 0 );
|
||||
#else
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
"backend_startup: starting \"%s\"\n",
|
||||
be->be_suffix[0].bv_val, 0, 0 );
|
||||
be->be_suffix ? be->be_suffix[0].bv_val : "(unknown)",
|
||||
0, 0 );
|
||||
#endif
|
||||
|
||||
if ( be->bd_info->bi_open ) {
|
||||
|
|
|
|||
|
|
@ -76,6 +76,8 @@ glue_back_select (
|
|||
bv.bv_val = (char *) dn;
|
||||
|
||||
for (i = 0; i<gi->nodes; i++) {
|
||||
assert( gi->n[i].be->be_nsuffix );
|
||||
|
||||
if (dnIsSuffix(&bv, &gi->n[i].be->be_nsuffix[0])) {
|
||||
return gi->n[i].be;
|
||||
}
|
||||
|
|
@ -323,6 +325,10 @@ glue_back_search ( Operation *op, SlapReply *rs )
|
|||
goto done;
|
||||
}
|
||||
op->o_bd = gi->n[i].be;
|
||||
|
||||
assert( op->o_bd->be_suffix );
|
||||
assert( op->o_bd->be_nsuffix );
|
||||
|
||||
if (scope0 == LDAP_SCOPE_ONELEVEL &&
|
||||
dn_match(&gi->n[i].pdn, &ndn))
|
||||
{
|
||||
|
|
@ -573,6 +579,8 @@ glue_sub_init( )
|
|||
if ( SLAP_GLUE_LINKED( be ) ) {
|
||||
continue;
|
||||
}
|
||||
assert( be->be_nsuffix );
|
||||
assert( b1->be_nsuffix );
|
||||
if (!dnIsSuffix(&be->be_nsuffix[0], &b1->be_nsuffix[0])) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ root_dse_info(
|
|||
}
|
||||
|
||||
for ( i = 0; i < nbackends; i++ ) {
|
||||
if ( backends[i].be_suffix == NULL
|
||||
|| backends[i].be_nsuffix == NULL ) {
|
||||
/* no suffix! */
|
||||
continue;
|
||||
}
|
||||
if ( backends[i].be_flags & SLAP_BFLAG_MONITOR ) {
|
||||
vals[0] = backends[i].be_suffix[0];
|
||||
nvals[0] = backends[i].be_nsuffix[0];
|
||||
|
|
|
|||
Loading…
Reference in a new issue