From 3d52e6336629daecf5c2cfed65e6f5b901be8f84 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 8 Sep 2014 15:40:28 +0100 Subject: [PATCH] ITS#7929 don't log internal searches --- servers/slapd/overlays/accesslog.c | 5 +++++ servers/slapd/overlays/memberof.c | 2 ++ servers/slapd/overlays/refint.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index 7c5f926b6f..099a481269 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -1509,6 +1509,11 @@ static int accesslog_response(Operation *op, SlapReply *rs) { ldap_pvt_thread_rmutex_unlock( &li->li_op_rmutex, op->o_tid ); } + /* ignore these internal reads */ + if (( lo->mask & LOG_OP_READS ) && op->o_do_not_cache ) { + return SLAP_CB_CONTINUE; + } + if ( li->li_success && rs->sr_err != LDAP_SUCCESS ) goto done; diff --git a/servers/slapd/overlays/memberof.c b/servers/slapd/overlays/memberof.c index 9370152204..17cbae7f85 100644 --- a/servers/slapd/overlays/memberof.c +++ b/servers/slapd/overlays/memberof.c @@ -293,6 +293,7 @@ memberof_isGroupOrMember( Operation *op, memberof_cbinfo_t *mci ) an[ 0 ].an_name = an[ 0 ].an_desc->ad_cname; op2.ors_filterstr = mo->mo_groupFilterstr; op2.ors_filter = &mo->mo_groupFilter; + op2.o_do_not_cache = 1; /* internal search, don't log */ memberof_set_backend( &op2, op, on ); (void)op->o_bd->be_search( &op2, &rs2 ); @@ -315,6 +316,7 @@ memberof_isGroupOrMember( Operation *op, memberof_cbinfo_t *mci ) an[ 0 ].an_name = an[ 0 ].an_desc->ad_cname; op2.ors_filterstr = mo->mo_memberFilterstr; op2.ors_filter = &mo->mo_memberFilter; + op2.o_do_not_cache = 1; /* internal search, don't log */ memberof_set_backend( &op2, op, on ); (void)op->o_bd->be_search( &op2, &rs2 ); diff --git a/servers/slapd/overlays/refint.c b/servers/slapd/overlays/refint.c index f0a3719022..8aa501254a 100644 --- a/servers/slapd/overlays/refint.c +++ b/servers/slapd/overlays/refint.c @@ -528,15 +528,19 @@ refint_repair( Operation op2; unsigned long opid; int rc; + int cache; op->o_callback->sc_response = refint_search_cb; op->o_req_dn = op->o_bd->be_suffix[ 0 ]; op->o_req_ndn = op->o_bd->be_nsuffix[ 0 ]; op->o_dn = op->o_bd->be_rootdn; op->o_ndn = op->o_bd->be_rootndn; + cache = op->o_do_not_cache; + op->o_do_not_cache = 1; /* search */ rc = op->o_bd->be_search( op, &rs ); + op->o_do_not_cache = cache; if ( rc != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_TRACE,