From e5b00b6511b53cefe4c7d9bc3db35b4cd8a0e75b Mon Sep 17 00:00:00 2001 From: Rabinarayan Panigrahi Date: Wed, 17 Sep 2025 17:02:26 +0530 Subject: [PATCH] passdb: Fixing CID 1509029 for time_t in DEBUG statement In the most likely scenario of time_t being 64 bit signed, we do the typecast to intmax_t to also log negative values correctly. Signed-off-by: Rabinarayan Panigrahi Reviewed-by: Andreas Schneider Reviewed-by: Douglas Bagnall Reviewed-by: Anoop C S Reviewed-by: Vinit Agnihotri Autobuild-User(master): Anoop C S Autobuild-Date(master): Wed Sep 24 06:44:50 UTC 2025 on atb-devel-224 --- source3/passdb/pdb_ldap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 4ab387b5a5c..73830d45fd6 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -1087,17 +1087,17 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state, /* see if we have newer updates */ if (!login_cache_read(sampass, &cache_entry)) { - DEBUG (9, ("No cache entry, bad count = %u, bad time = %u\n", + DEBUG (9, ("No cache entry, bad count = %u, bad time = %jd\n", (unsigned int)pdb_get_bad_password_count(sampass), - (unsigned int)pdb_get_bad_password_time(sampass))); + (intmax_t)pdb_get_bad_password_time(sampass))); ret = true; goto fn_exit; } - DEBUG(7, ("ldap time is %u, cache time is %u, bad time = %u\n", - (unsigned int)ldap_entry_time, - (unsigned int)cache_entry.entry_timestamp, - (unsigned int)cache_entry.bad_password_time)); + DEBUG(7, ("ldap time is %jd, cache time is %jd, bad time = %jd\n", + (intmax_t)ldap_entry_time, + (intmax_t)cache_entry.entry_timestamp, + (intmax_t)cache_entry.bad_password_time)); if (ldap_entry_time > cache_entry.entry_timestamp) { /* cache is older than directory , so -- 2.47.3