mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
fix ITS#2343
This commit is contained in:
parent
498f8a7454
commit
51849d6ecb
@ -103,7 +103,7 @@ monitor_subsys_database_init(
|
||||
be = &backendDB[i];
|
||||
|
||||
/* Subordinates are not exposed as their own naming context */
|
||||
if ( be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE ) {
|
||||
if ( SLAP_GLUE_SUBORDINATE( be ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ select_backend(
|
||||
for ( j = 0; backends[i].be_nsuffix != NULL &&
|
||||
backends[i].be_nsuffix[j].bv_val != NULL; j++ )
|
||||
{
|
||||
if (( backends[i].be_flags & SLAP_BFLAG_GLUE_SUBORDINATE )
|
||||
if ( ( SLAP_GLUE_SUBORDINATE( &backends[i] ) )
|
||||
&& noSubs )
|
||||
{
|
||||
continue;
|
||||
|
@ -610,7 +610,7 @@ glue_sub_init( )
|
||||
* backends and connect them to their superior.
|
||||
*/
|
||||
for (i = nBackendDB - 1, b1=&backendDB[i]; cont && i>=0; b1--,i--) {
|
||||
if (b1->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE) {
|
||||
if (SLAP_GLUE_SUBORDINATE ( b1 ) ) {
|
||||
/* The last database cannot be a subordinate of noone */
|
||||
if (i == nBackendDB - 1) {
|
||||
b1->be_flags ^= SLAP_BFLAG_GLUE_SUBORDINATE;
|
||||
@ -619,11 +619,11 @@ glue_sub_init( )
|
||||
}
|
||||
gi = NULL;
|
||||
for (j = i-1, be=&backendDB[j]; j>=0; be--,j--) {
|
||||
if (!(be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE)) {
|
||||
if ( ! SLAP_GLUE_SUBORDINATE( be ) ) {
|
||||
continue;
|
||||
}
|
||||
/* We will only link it once */
|
||||
if (be->be_flags & SLAP_BFLAG_GLUE_LINKED) {
|
||||
if ( SLAP_GLUE_LINKED( be ) ) {
|
||||
continue;
|
||||
}
|
||||
if (!dnIsSuffix(&be->be_nsuffix[0], &b1->be_nsuffix[0])) {
|
||||
|
@ -137,7 +137,7 @@ root_dse_info(
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if ( backends[i].be_flags & SLAP_BFLAG_GLUE_SUBORDINATE ) {
|
||||
if ( SLAP_GLUE_SUBORDINATE( &backends[i] ) ) {
|
||||
continue;
|
||||
}
|
||||
for ( j = 0; backends[i].be_suffix[j].bv_val != NULL; j++ ) {
|
||||
|
@ -1334,6 +1334,10 @@ struct slap_backend_db {
|
||||
#define SLAP_BFLAG_DYNAMIC 0x2000U
|
||||
slap_mask_t be_flags;
|
||||
#define SLAP_LASTMOD(be) (!((be)->be_flags & SLAP_BFLAG_NOLASTMOD))
|
||||
#define SLAP_GLUE_INSTANCE(be) ((be)->be_flags & SLAP_BFLAG_GLUE_INSTANCE)
|
||||
#define SLAP_GLUE_SUBORDINATE(be) \
|
||||
((be)->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE)
|
||||
#define SLAP_GLUE_LINKED(be) ((be)->be_flags & SLAP_BFLAG_GLUE_LINKED)
|
||||
#define SLAP_ALIASES(be) ((be)->be_flags & SLAP_BFLAG_ALIASES)
|
||||
#define SLAP_REFERRALS(be) ((be)->be_flags & SLAP_BFLAG_REFERRALS)
|
||||
#define SLAP_SUBENTRIES(be) ((be)->be_flags & SLAP_BFLAG_SUBENTRIES)
|
||||
|
@ -250,7 +250,7 @@ slap_tool_init(
|
||||
/* If the named base is a glue master, operate on the
|
||||
* entire context
|
||||
*/
|
||||
if (be->be_flags & SLAP_BFLAG_GLUE_INSTANCE)
|
||||
if (SLAP_GLUE_INSTANCE(be))
|
||||
nosubordinates = 1;
|
||||
|
||||
} else if ( dbnum == -1 ) {
|
||||
@ -258,8 +258,10 @@ slap_tool_init(
|
||||
/* If just doing the first by default and it is a
|
||||
* glue subordinate, find the master.
|
||||
*/
|
||||
while (be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE) {
|
||||
nosubordinates = 1;
|
||||
while (SLAP_GLUE_SUBORDINATE(be) || SLAP_MONITOR(be)) {
|
||||
if (SLAP_GLUE_SUBORDINATE(be)) {
|
||||
nosubordinates = 1;
|
||||
}
|
||||
be++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user