]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:lib: Fix the debug message for adding cache entries.
authorAndreas Schneider <asn@samba.org>
Thu, 17 Jan 2019 12:58:14 +0000 (13:58 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Apr 2019 09:09:55 +0000 (09:09 +0000)
To get correct values, we need to cast 'timeout' to 'long int' first in
order to do calculation in that integer space! Calculations are don in
the space of the lvalue!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13848

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 5822449a7340f53987ce4c04851652427f5b49e8)

source3/lib/gencache.c

index ab12fc1c531c29fd246a7bf44e395a0e8c46e59e..9f4e1cfcaa3a89b7dd390d6303122e69d6735c0b 100644 (file)
@@ -294,11 +294,11 @@ bool gencache_set_data_blob(const char *keystr, DATA_BLOB blob,
        dbufs[0] = (TDB_DATA) { .dptr = (uint8_t *)hdr, .dsize = hdr_len };
        dbufs[1] = (TDB_DATA) { .dptr = blob.data, .dsize = blob.length };
 
-       DEBUG(10, ("Adding cache entry with key=[%s] and timeout="
-                  "[%s] (%d seconds %s)\n", keystr,
+       DBG_DEBUG("Adding cache entry with key=[%s] and timeout="
+                  "[%s] (%ld seconds %s)\n", keystr,
                   timestring(talloc_tos(), timeout),
-                  (int)(timeout - time(NULL)), 
-                  timeout > time(NULL) ? "ahead" : "in the past"));
+                  ((long int)timeout) - time(NULL),
+                  timeout > time(NULL) ? "ahead" : "in the past");
 
        ret = tdb_storev(cache_notrans->tdb, string_term_tdb_data(keystr),
                         dbufs, 2, 0);