X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbackglue.c;h=29a781102fa8e2a6d918f6fc7f895dde946d4208;hb=86bd3651e1bc6129cf2bd4ba271f33207843aaff;hp=9a320205219dc2586cb19e2be92186cf8d06ed91;hpb=beaa0f2250470b227369165195d271585db1d13e;p=openldap diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index 9a32020521..29a781102f 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -716,6 +716,7 @@ glue_db_init( { slap_overinst *on = (slap_overinst *)be->bd_info; slap_overinfo *oi = on->on_info; + BackendInfo *bi = oi->oi_orig; glueinfo *gi; gi = ch_calloc( 1, sizeof(glueinfo)); @@ -730,14 +731,23 @@ glue_db_init( oi->oi_bi.bi_entry_release_rw = glue_entry_release_rw; - oi->oi_bi.bi_tool_entry_open = glue_tool_entry_open; - oi->oi_bi.bi_tool_entry_close = glue_tool_entry_close; - oi->oi_bi.bi_tool_entry_first = glue_tool_entry_first; - oi->oi_bi.bi_tool_entry_next = glue_tool_entry_next; - oi->oi_bi.bi_tool_entry_get = glue_tool_entry_get; - oi->oi_bi.bi_tool_entry_put = glue_tool_entry_put; - oi->oi_bi.bi_tool_entry_reindex = glue_tool_entry_reindex; - oi->oi_bi.bi_tool_sync = glue_tool_sync; + /* Only advertise these if the root DB supports them */ + if ( bi->bi_tool_entry_open ) + oi->oi_bi.bi_tool_entry_open = glue_tool_entry_open; + if ( bi->bi_tool_entry_close ) + oi->oi_bi.bi_tool_entry_close = glue_tool_entry_close; + if ( bi->bi_tool_entry_first ) + oi->oi_bi.bi_tool_entry_first = glue_tool_entry_first; + if ( bi->bi_tool_entry_next ) + oi->oi_bi.bi_tool_entry_next = glue_tool_entry_next; + if ( bi->bi_tool_entry_get ) + oi->oi_bi.bi_tool_entry_get = glue_tool_entry_get; + if ( bi->bi_tool_entry_put ) + oi->oi_bi.bi_tool_entry_put = glue_tool_entry_put; + if ( bi->bi_tool_entry_reindex ) + oi->oi_bi.bi_tool_entry_reindex = glue_tool_entry_reindex; + if ( bi->bi_tool_sync ) + oi->oi_bi.bi_tool_sync = glue_tool_sync; /*FIXME : need to add support */ oi->oi_bi.bi_tool_dn2id_get = 0; @@ -899,16 +909,9 @@ glue_sub_add( BackendDB *be, int advert, int online ) SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_ADVERTISE; ga = ch_malloc( sizeof( glue_Addrec )); - ga->ga_next = NULL; + ga->ga_next = ga_list; ga->ga_be = be; - if ( ga_list ) { - glue_Addrec *g2 = ga_list; - - for ( ; g2 && g2->ga_next; g2=g2->ga_next ); - g2->ga_next = ga; - } else { - ga_list = ga; - } + ga_list = ga; if ( online ) rc = glue_sub_attach();