]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pdbedit: Avoid a use of convert_time_t_to_uint32_t()
authorVolker Lendecke <vl@samba.org>
Sat, 16 Nov 2024 12:32:20 +0000 (13:32 +0100)
committerMartin Schwenke <martins@samba.org>
Mon, 2 Dec 2024 04:53:33 +0000 (04:53 +0000)
We should avoid converting time_t to 32 bit wherever possible

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/utils/pdbedit.c

index eb6b98239028b89c45551ef1dce99c9ff577dba6..dae810c1dceaa23bc31f411f0f2a80fc904d122f 100644 (file)
@@ -338,13 +338,13 @@ static int print_sam_info (struct samu *sam_pwent, bool verbosity, bool smbpwdst
                pdb_sethexpwd(lm_passwd, pdb_get_lanman_passwd(sam_pwent), pdb_get_acct_ctrl(sam_pwent));
                pdb_sethexpwd(nt_passwd, pdb_get_nt_passwd(sam_pwent), pdb_get_acct_ctrl(sam_pwent));
 
-               printf("%s:%lu:%s:%s:%s:LCT-%08X:\n",
+               printf("%s:%lu:%s:%s:%s:LCT-%08" PRIX64 ":\n",
                       pdb_get_username(sam_pwent),
                       (unsigned long)uid,
                       lm_passwd,
                       nt_passwd,
                       pdb_encode_acct_ctrl(pdb_get_acct_ctrl(sam_pwent),NEW_PW_FORMAT_SPACE_PADDED_LEN),
-                      (uint32_t)convert_time_t_to_uint32_t(pdb_get_pass_last_set_time(sam_pwent)));
+                      (int64_t)pdb_get_pass_last_set_time(sam_pwent));
        } else {
                uid = nametouid(pdb_get_username(sam_pwent));
                printf ("%s:%lu:%s\n", pdb_get_username(sam_pwent), (unsigned long)uid,