Blob Blame History Raw
From c8977a03f2c65978ad7977030d55bc830bc1f852 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Wed, 16 Oct 2019 16:52:59 -0400
Subject: [PATCH] Issue 50655 - access log etime is not properly formatted

Description:  The wrong printf format was used for displaying the nanosecond etime
              in the access log.

relates: https://pagure.io/389-ds-base/issue/50655

Reviewed by: firstyear(Thanks!)
---
 ldap/servers/slapd/result.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index d9f431cc5..393b3f6cd 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -1920,7 +1920,8 @@ log_result(Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, int nentries
     struct timespec o_hr_time_end;
     slapi_operation_time_elapsed(op, &o_hr_time_end);
 
-    snprintf(etime, ETIME_BUFSIZ, "%" PRId64 ".%010" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
+
+    snprintf(etime, ETIME_BUFSIZ, "%" PRId64 ".%.09" PRId64 "", (int64_t)o_hr_time_end.tv_sec, (int64_t)o_hr_time_end.tv_nsec);
 
     slapi_pblock_get(pb, SLAPI_OPERATION_NOTES, &operation_notes);
 
-- 
2.21.1