From ba0a748654b11bff5caaf3e8aca0ab7a5bd7022c Mon Sep 17 00:00:00 2001 From: Rabinarayan Panigrahi Date: Fri, 5 Sep 2025 09:23:39 +0530 Subject: [PATCH] utils: Fixing CID 1508980 for time_t in DEBUG statement 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 Reviewed-by: Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider --- source3/utils/net_rpc_sh_acct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/utils/net_rpc_sh_acct.c b/source3/utils/net_rpc_sh_acct.c index 55abafb4bca..e14fd1823e2 100644 --- a/source3/utils/net_rpc_sh_acct.c +++ b/source3/utils/net_rpc_sh_acct.c @@ -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")); } -- 2.47.3