time.c: fix ctime which was feeded with the mtime seconds
authorBjörn Jacke <bjacke@samba.org>
Sun, 7 Jan 2024 04:09:58 +0000 (05:09 +0100)
committerJule Anger <janger@samba.org>
Mon, 22 Jan 2024 09:55:16 +0000 (09:55 +0000)
This bug was introduced with 53a1d034f3e47ed3c in 2020.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15550

Signed-off-by: Bjoern Jacke <bjacke@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 2df2e34c3c1ccf76bbcc78586cbbb6433b6d30d5)

lib/util/time.c

index c2a77d664d37a21107134cf81950d4389d2ebbda..9393a754d7356ea31f651b4d40fc03c594f3a641 100644 (file)
@@ -1450,7 +1450,7 @@ struct timespec get_ctimespec(const struct stat *pst)
 {
        struct timespec ret;
 
-       ret.tv_sec = pst->st_mtime;
+       ret.tv_sec = pst->st_ctime;
        ret.tv_nsec = get_ctimensec(pst);
        return ret;
 }