mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -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
|
|
@ -282,6 +282,24 @@ nextido:
|
||||||
}
|
}
|
||||||
return rs->sr_err;
|
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)
|
#if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
|
||||||
#define IS_BDB_REPLACE(type) (( type == LDAP_PSEARCH_BY_DELETE ) || \
|
#define IS_BDB_REPLACE(type) (( type == LDAP_PSEARCH_BY_DELETE ) || \
|
||||||
|
|
@ -455,6 +473,25 @@ int bdb_search( Operation *op, SlapReply *rs )
|
||||||
|
|
||||||
manageDSAit = get_manageDSAit( sop );
|
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 );
|
rs->sr_err = LOCK_ID (bdb->bi_dbenv, &locker );
|
||||||
|
|
||||||
switch(rs->sr_err) {
|
switch(rs->sr_err) {
|
||||||
|
|
@ -910,23 +947,25 @@ id2entry_retry:
|
||||||
|
|
||||||
rs->sr_entry = e;
|
rs->sr_entry = e;
|
||||||
#ifdef BDB_SUBENTRIES
|
#ifdef BDB_SUBENTRIES
|
||||||
if ( is_entry_subentry( e ) ) {
|
if ( !is_sync_protocol( sop ) ) {
|
||||||
if( sop->oq_search.rs_scope != LDAP_SCOPE_BASE ) {
|
if ( is_entry_subentry( e ) ) {
|
||||||
if(!get_subentries_visibility( sop )) {
|
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 */
|
/* only subentries are visible */
|
||||||
goto loop_continue;
|
goto loop_continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ( get_subentries( sop ) &&
|
} else if ( get_subentries_visibility( sop )) {
|
||||||
!get_subentries_visibility( sop ))
|
|
||||||
{
|
|
||||||
/* only subentries are visible */
|
/* only subentries are visible */
|
||||||
goto loop_continue;
|
goto loop_continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ( get_subentries_visibility( sop )) {
|
|
||||||
/* only subentries are visible */
|
|
||||||
goto loop_continue;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -1502,7 +1541,8 @@ static int search_candidates(
|
||||||
* these clauses are redundant.
|
* these clauses are redundant.
|
||||||
*/
|
*/
|
||||||
if (!oc_filter(op->oq_search.rs_filter, 1, &depth)
|
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) ) {
|
if( !get_manageDSAit(op) && !get_domainScope(op) ) {
|
||||||
/* match referral objects */
|
/* match referral objects */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue