]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
utils: Fixing CID 1508980 for time_t in DEBUG statement
authorRabinarayan Panigrahi <rapanigr@redhat.com>
Fri, 5 Sep 2025 03:53:39 +0000 (09:23 +0530)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 10 Sep 2025 09:38:30 +0000 (09:38 +0000)
Fix: typecast changing from (int)t  to (intmax_t)t
as intmax_t can hold epoch seconds after 2038 year

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/utils/net_rpc_sh_acct.c

index 55abafb4bcae410f776d306fd7588d267d3902dc..e14fd1823e2740b835e21cf243a6c0061f8138cb 100644 (file)
@@ -220,7 +220,7 @@ static int account_show(struct net_context *c,
                d_printf(_("Account lockout duration: "));
                if (nt_time_is_set(&i12->lockout_duration)) {
                        time_t t = nt_time_to_unix_abs(&i12->lockout_duration);
-                       d_printf(_("%d seconds\n"), (int)t);
+                       d_printf(_("%jd seconds\n"), (intmax_t)t);
                } else {
                        d_printf(_("not set\n"));
                }
@@ -228,7 +228,7 @@ static int account_show(struct net_context *c,
                d_printf(_("Bad password count reset after: "));
                if (nt_time_is_set(&i12->lockout_window)) {
                        time_t t = nt_time_to_unix_abs(&i12->lockout_window);
-                       d_printf(_("%d seconds\n"), (int)t);
+                       d_printf(_("%jd seconds\n"), (intmax_t)t);
                } else {
                        d_printf(_("not set\n"));
                }