]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
passdb: Fixing CID 1509029 for time_t in DEBUG statement
authorRabinarayan Panigrahi <rapanigr@redhat.com>
Wed, 17 Sep 2025 11:32:26 +0000 (17:02 +0530)
committerAnoop C S <anoopcs@samba.org>
Wed, 24 Sep 2025 06:44:50 +0000 (06:44 +0000)
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 <rapanigr@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Vinit Agnihotri <vagnihot@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Wed Sep 24 06:44:50 UTC 2025 on atb-devel-224

source3/passdb/pdb_ldap.c

index 4ab387b5a5ce45b93ec9af418fb1118dcf387ab1..73830d45fd6be5d466085096e6a785ab8baccdff 100644 (file)
@@ -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