[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#8649) Issue when fetching the backend that will receive the contextCSN when we have glued databases
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#8649) Issue when fetching the backend that will receive the contextCSN when we have glued databases
- From: elecharny@gmail.com
- Date: Sat, 29 Apr 2017 00:06:30 +0000
- Auto-submitted: auto-generated (OpenLDAP-ITS)
Using a function to compute the working backend, it could be something
like :
void setWorkingBackend( syncinfo_t *syncInfo, Backend *backend )
{
if ( !syncInfo->si_wbe )
{
if ( SLAP_GLUE_SUBORDINATE( backend ) && !overlay_is_inst(
backend, "syncprov" ) )
{
// The backend has a parent backend, fetch it. Note that we
want to get the
// top parent, not one of the intermediary subordinate,
unless one of them
// has a syncprov overlay declared. If the top level backend
// does not have a syncprov overlay declared, then we use
the local DB
// as a working backend.
BackendDB *currentBackend = backend;
struct berval bv;
ber_str2bv( currentBackend->be_nsuffix[0].bv_val, 0, 0, &bv );
dnParent( &bv, &bv );
while ( ( currentBackend = select_backend( &bv, 0 ) ) != NULL )
{
if ( overlay_is_inst( currentBackend, "syncprov" ) )
{
syncInfo->si_wbe = currentBackend;
break;
}
dnParent( &bv, &bv );
}
if ( syncInfo->si_wbe == NULL )
{
syncInfo->si_wbe = backend;
}
}
else
{
syncInfo->si_wbe = backend;
}
if ( SLAP_SYNC_SUBENTRY( syncInfo->si_wbe ) )
{
build_new_dn( &syncInfo->si_contextdn,
&syncInfo->si_wbe->be_nsuffix[0], (struct berval *)
&slap_ldapsync_cn_bv, NULL );
}
else
{
syncInfo->si_contextdn = syncInfo->si_wbe->be_nsuffix[0];
}
}
}
We call it with
setWorkingBackend( si, be );
--
Emmanuel Lecharny
Symas.com
directory.apache.org