d4e26e
From b748757044ebe5a48119b5b8e31f23b423af736c Mon Sep 17 00:00:00 2001
d4e26e
From: Mark Reynolds <mreynolds@redhat.com>
d4e26e
Date: Mon, 29 Mar 2021 15:19:53 -0400
d4e26e
Subject: [PATCH] Issue 4706 - negative wtime in access log for CMP operations
d4e26e
d4e26e
Description:  We forgot to set the start time for compare operations,
d4e26e
              this led to invalid values in the access log for optime
d4e26e
              and wtime.
d4e26e
d4e26e
relates: https://github.com/389ds/389-ds-base/issues/4706
d4e26e
d4e26e
Reviewed by: mreynolds (one line commit ruile)
d4e26e
---
d4e26e
 ldap/servers/slapd/compare.c | 5 +++++
d4e26e
 1 file changed, 5 insertions(+)
d4e26e
d4e26e
diff --git a/ldap/servers/slapd/compare.c b/ldap/servers/slapd/compare.c
d4e26e
index 88a6c3599..cb4a2c4c6 100644
d4e26e
--- a/ldap/servers/slapd/compare.c
d4e26e
+++ b/ldap/servers/slapd/compare.c
d4e26e
@@ -52,6 +52,11 @@ do_compare(Slapi_PBlock *pb)
d4e26e
 
d4e26e
     slapi_pblock_get(pb, SLAPI_OPERATION, &pb_op);
d4e26e
     slapi_pblock_get(pb, SLAPI_CONNECTION, &pb_conn);
d4e26e
+
d4e26e
+    /* Set the time we actually started the operation */
d4e26e
+    if (pb_op) {
d4e26e
+        slapi_operation_set_time_started(pb_op);
d4e26e
+    }
d4e26e
     if (pb_op == NULL || pb_conn == NULL) {
d4e26e
         slapi_log_err(SLAPI_LOG_ERR, "do_compare", "NULL param: pb_conn (0x%p) pb_op (0x%p)\n",
d4e26e
                       pb_conn, pb_op);
d4e26e
-- 
d4e26e
2.30.2
d4e26e