mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-17 14:00:30 +08:00
reduce code duplication
This commit is contained in:
parent
bca52e1b18
commit
3cd65c0a5d
@ -108,46 +108,12 @@ dynlist_is_dynlist_next( Operation *op, SlapReply *rs, dynlist_info_t *old_dli )
|
||||
for ( ; dli; dli = dli->dli_next ) {
|
||||
if ( dli->dli_lud != NULL ) {
|
||||
/* check base and scope */
|
||||
if ( !BER_BVISNULL( &dli->dli_uri_nbase ) ) {
|
||||
int d = rs->sr_entry->e_nname.bv_len - dli->dli_uri_nbase.bv_len;
|
||||
|
||||
if ( d < 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( !dnIsSuffix( &rs->sr_entry->e_nname, &dli->dli_uri_nbase ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch ( dli->dli_lud->lud_scope ) {
|
||||
case LDAP_SCOPE_BASE:
|
||||
if ( d != 0 ) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
case LDAP_SCOPE_ONELEVEL: {
|
||||
struct berval pdn;
|
||||
|
||||
dnParent( &rs->sr_entry->e_nname, &pdn );
|
||||
if ( pdn.bv_len != dli->dli_uri_nbase.bv_len ) {
|
||||
continue;
|
||||
}
|
||||
} break;
|
||||
|
||||
case LDAP_SCOPE_SUBORDINATE:
|
||||
if ( d == 0 ) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
case LDAP_SCOPE_SUBTREE:
|
||||
case LDAP_SCOPE_DEFAULT:
|
||||
break;
|
||||
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
if ( !BER_BVISNULL( &dli->dli_uri_nbase )
|
||||
&& !dnIsSuffixScope( &rs->sr_entry->e_nname,
|
||||
&dli->dli_uri_nbase,
|
||||
dli->dli_lud->lud_scope ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check filter */
|
||||
|
Loading…
Reference in New Issue
Block a user