* OLcfg{Bk|Db}{Oc|At}:0 -> common
* OLcfg{Bk|Db}{Oc|At}:1 -> back-bdb(/back-hdb)
* OLcfg{Bk|Db}{Oc|At}:2 -> back-ldif
- * OLcfg{Bk|Db}{Oc|At}:3 -> back-ldap
+ * OLcfg{Bk|Db}{Oc|At}:3 -> back-ldap/meta
* OLcfg{Bk|Db}{Oc|At}:4 -> back-monitor
* OLcfg{Bk|Db}{Oc|At}:5 -> back-relay
* OLcfg{Bk|Db}{Oc|At}:6 -> back-sql(/back-ndb)
} ServerID;
static ServerID *sid_list;
-static int sid_set;
+static ServerID *sid_set;
typedef struct voidList {
struct voidList *vl_next;
si; si = *sip, i++ ) {
if ( c->valx == -1 || i == c->valx ) {
*sip = si->si_next;
+ if ( sid_set == si )
+ sid_set = NULL;
ch_free( si );
if ( c->valx >= 0 )
break;
Debug( LDAP_DEBUG_CONFIG,
"%s: SID=0x%03x\n",
c->log, slap_serverID, 0 );
- sid_set = 1;
+ sid_set = si;
}
si->si_next = NULL;
si->si_num = num;
"%s: SID=0x%03x (listener=%s)\n",
c->log, slap_serverID,
l->sl_url.bv_val );
- sid_set = 1;
+ sid_set = si;
}
}
if ( c->argc > 2 )
}
#endif
- if (SLAP_DB_ONE_SUFFIX( c->be ) && c->be->be_suffix ) {
+ if (SLAP_DB_ONE_SUFFIX( c->be ) && c->be->be_suffix &&
+ !BER_BVISNULL( &c->be->be_suffix[0] )) {
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",
}
}
- /* count related kids */
- for (nsibs=0, ce=parent->ce_kids; ce; ce=ce->ce_sibs) {
- if ( ce->ce_type == ce_type ) nsibs++;
+ /* count related kids.
+ * For entries of type Cft_Misc, only count siblings with same RDN type
+ */
+ if ( ce_type == Cft_Misc ) {
+ rdn.bv_val = e->e_nname.bv_val;
+ ptr1 = strchr( rdn.bv_val, '=' );
+ assert( ptr1 != NULL );
+
+ rdn.bv_len = ptr1 - rdn.bv_val;
+
+ for (nsibs=0, ce=parent->ce_kids; ce; ce=ce->ce_sibs) {
+ struct berval rdn2;
+ if ( ce->ce_type != ce_type )
+ continue;
+
+ dnRdn( &ce->ce_entry->e_nname, &rdn2 );
+
+ ptr1 = strchr( rdn2.bv_val, '=' );
+ assert( ptr1 != NULL );
+
+ rdn2.bv_len = ptr1 - rdn2.bv_val;
+ if ( bvmatch( &rdn, &rdn2 ))
+ nsibs++;
+ }
+ } else {
+ for (nsibs=0, ce=parent->ce_kids; ce; ce=ce->ce_sibs) {
+ if ( ce->ce_type == ce_type ) nsibs++;
+ }
}
/* account for -1 frontend */