From: Rabinarayan Panigrahi Date: Fri, 5 Sep 2025 03:53:39 +0000 (+0530) Subject: utils: Fixing CID 1508980 for time_t in DEBUG statement X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba0a748654b11bff5caaf3e8aca0ab7a5bd7022c;p=thirdparty%2Fsamba.git 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 --- 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")); }