]> git.sur5r.net Git - openldap/commitdiff
ITS#7929 don't log internal searches
authorHoward Chu <hyc@openldap.org>
Mon, 8 Sep 2014 14:40:28 +0000 (15:40 +0100)
committerHoward Chu <hyc@openldap.org>
Mon, 8 Sep 2014 14:40:28 +0000 (15:40 +0100)
servers/slapd/overlays/accesslog.c
servers/slapd/overlays/memberof.c
servers/slapd/overlays/refint.c

index 7c5f926b6fd9bfc43decdc7b4a25165036afb560..099a481269429fb663d420d391ba1b2a64044e44 100644 (file)
@@ -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;
 
index 9370152204ff95d03e30d1ed4de5cfbfc09dab92..17cbae7f85834a32a402c49755171f9603889e0b 100644 (file)
@@ -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 );
index f0a371902287efe1538bda3186bb77d0d171f709..8aa501254a783bac0cb1953008f4a823f070b947 100644 (file)
@@ -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,