mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 08:09:34 -05:00
- manageDSAit is implicitly assumed for LCUP / SYNC
- LCUP / SYNC search both entries and subentries at the same time
This commit is contained in:
parent
2fd73195f5
commit
b10f1c5780
1 changed files with 51 additions and 11 deletions
|
|
@ -283,6 +283,24 @@ nextido:
|
|||
return rs->sr_err;
|
||||
}
|
||||
|
||||
static
|
||||
int is_sync_protocol( Operation *op )
|
||||
{
|
||||
#if !defined(LDAP_CLIENT_UPDATE) && !defined(LDAP_SYNC)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
#ifdef LDAP_CLIENT_UPDATE
|
||||
if ( op->o_clientupdate_type & SLAP_LCUP_SYNC_AND_PERSIST )
|
||||
return 1;
|
||||
#endif
|
||||
#ifdef LDAP_SYNC
|
||||
if ( op->o_sync_mode & SLAP_SYNC_REFRESH_AND_PERSIST )
|
||||
return 1;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
|
||||
#define IS_BDB_REPLACE(type) (( type == LDAP_PSEARCH_BY_DELETE ) || \
|
||||
( type == LDAP_PSEARCH_BY_SCOPEOUT ))
|
||||
|
|
@ -455,6 +473,25 @@ int bdb_search( Operation *op, SlapReply *rs )
|
|||
|
||||
manageDSAit = get_manageDSAit( sop );
|
||||
|
||||
/* Sync / LCUP controls override manageDSAit */
|
||||
|
||||
#ifdef LDAP_CLIENT_UPDATE
|
||||
if ( !IS_PSEARCH && sop->o_clientupdate_type & SLAP_LCUP_SYNC ) {
|
||||
if ( manageDSAit == SLAP_NO_CONTROL )
|
||||
manageDSAit = SLAP_CRITICAL_CONTROL;
|
||||
} else
|
||||
#endif
|
||||
#ifdef LDAP_SYNC
|
||||
if ( !IS_PSEARCH && sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
|
||||
if ( manageDSAit == SLAP_NO_CONTROL )
|
||||
manageDSAit = SLAP_CRITICAL_CONTROL;
|
||||
} else
|
||||
#endif
|
||||
if ( IS_PSEARCH ) {
|
||||
if ( manageDSAit == SLAP_NO_CONTROL )
|
||||
manageDSAit = SLAP_CRITICAL_CONTROL;
|
||||
}
|
||||
|
||||
rs->sr_err = LOCK_ID (bdb->bi_dbenv, &locker );
|
||||
|
||||
switch(rs->sr_err) {
|
||||
|
|
@ -910,23 +947,25 @@ id2entry_retry:
|
|||
|
||||
rs->sr_entry = e;
|
||||
#ifdef BDB_SUBENTRIES
|
||||
if ( is_entry_subentry( e ) ) {
|
||||
if( sop->oq_search.rs_scope != LDAP_SCOPE_BASE ) {
|
||||
if(!get_subentries_visibility( sop )) {
|
||||
if ( !is_sync_protocol( sop ) ) {
|
||||
if ( is_entry_subentry( e ) ) {
|
||||
if( sop->oq_search.rs_scope != LDAP_SCOPE_BASE ) {
|
||||
if(!get_subentries_visibility( sop )) {
|
||||
/* only subentries are visible */
|
||||
goto loop_continue;
|
||||
}
|
||||
|
||||
} else if ( get_subentries( sop ) &&
|
||||
!get_subentries_visibility( sop ))
|
||||
{
|
||||
/* only subentries are visible */
|
||||
goto loop_continue;
|
||||
}
|
||||
|
||||
} else if ( get_subentries( sop ) &&
|
||||
!get_subentries_visibility( sop ))
|
||||
{
|
||||
} else if ( get_subentries_visibility( sop )) {
|
||||
/* only subentries are visible */
|
||||
goto loop_continue;
|
||||
}
|
||||
|
||||
} else if ( get_subentries_visibility( sop )) {
|
||||
/* only subentries are visible */
|
||||
goto loop_continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1502,7 +1541,8 @@ static int search_candidates(
|
|||
* these clauses are redundant.
|
||||
*/
|
||||
if (!oc_filter(op->oq_search.rs_filter, 1, &depth)
|
||||
&& !get_subentries_visibility(op) )
|
||||
&& !get_subentries_visibility(op)
|
||||
&& !is_sync_protocol(op) )
|
||||
{
|
||||
if( !get_manageDSAit(op) && !get_domainScope(op) ) {
|
||||
/* match referral objects */
|
||||
|
|
|
|||
Loading…
Reference in a new issue