From 2fd73195f57bff0d1dceeef765bb91abca4d2c38 Mon Sep 17 00:00:00 2001 From: Jong Hyuk Choi Date: Wed, 30 Apr 2003 02:01:03 +0000 Subject: [PATCH] LCUP / SYNC overrides manageDSAit upon calling select_backend() --- servers/slapd/search.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 15b99f30a0..1d53226ce0 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -43,6 +43,7 @@ do_search( struct berval base = { 0, NULL }; ber_len_t siz, off, i; int manageDSAit; + int be_manageDSAit; #ifdef LDAP_SLAPI char **attrs = NULL; #endif @@ -330,7 +331,28 @@ do_search( * appropriate one, or send a referral to our "referral server" * if we don't hold it. */ - if ( (op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 1 )) == NULL ) { + + /* Sync / LCUP controls override manageDSAit */ + + if ( manageDSAit != SLAP_NO_CONTROL ) { +#ifdef LDAP_CLIENT_UPDATE + if ( op->o_clientupdate_type & SLAP_LCUP_SYNC ) { + be_manageDSAit = SLAP_NO_CONTROL; + } else +#endif +#ifdef LDAP_SYNC + if ( op->o_sync_mode & SLAP_SYNC_REFRESH ) { + be_manageDSAit = SLAP_NO_CONTROL; + } else +#endif + { + be_manageDSAit = manageDSAit; + } + } else { + be_manageDSAit = manageDSAit; + } + + if ( (op->o_bd = select_backend( &op->o_req_ndn, be_manageDSAit, 1 )) == NULL ) { rs->sr_ref = referral_rewrite( default_referral, NULL, &op->o_req_dn, op->ors_scope ); -- 2.39.5