]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
utils: Fixing CID 1509034 for time_t in DEBUG statement
authorRabinarayan Panigrahi <rapanigr@redhat.com>
Fri, 5 Sep 2025 04:15:20 +0000 (09:45 +0530)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 10 Sep 2025 09:38:30 +0000 (09:38 +0000)
Fix: typecast changing from (int)nt_time_to_unix_abs(&i12->lockout_window)
to (intmax_t)nt_time_to_unix_abs(&i12->lockout_window)
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 e14fd1823e2740b835e21cf243a6c0061f8138cb..d1a0c5eb6f59deeeafaf1238d65d18abb15a72d9 100644 (file)
@@ -325,8 +325,8 @@ static int account_set_resetduration(struct net_context *c,
        }
 
        unix_to_nt_time_abs(&i12->lockout_window, atoi(argv[0]));
-       d_printf(_("Setting bad password reset duration to %d seconds\n"),
-                (int)nt_time_to_unix_abs(&i12->lockout_window));
+       d_printf(_("Setting bad password reset duration to %jd seconds\n"),
+                (intmax_t)nt_time_to_unix_abs(&i12->lockout_window));
 
        return 12;
 }