andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
Blob Blame History Raw
From f4a5a7f3074e15c3439fd906bef78568bd6ab13c 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 34ddd8566..61e7a70f9 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -1925,7 +1925,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.0