From 4afd89d3c0415fdf8ec1a61cc0fb72fbae22b087 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Tue, 2 May 2023 09:49:10 -0700 Subject: [PATCH] Ensure that directory entries use gmtime(3) over localtime(3). This was originally reported by Alper Nebi Yasak in Debian bug #1035375 . I can confirm that Alper's minimal testcase fails without this change (and passes with it). Signed-off-by: Chris Lamb --- directory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/directory.c b/directory.c index 7625699..4a49411 100644 --- a/directory.c +++ b/directory.c @@ -104,7 +104,7 @@ struct directory *mk_entry(const dos_name_t *dn, unsigned char attr, uint8_t hour, min_hi, min_low, sec; uint8_t year, month_hi, month_low, day; - now = localtime(&date2); + now = gmtime(&date2); dosnameToDirentry(dn, ndir); ndir->attr = attr; ndir->ctime_ms = 0; -- 2.40.1