Debian Bug report logs -
#1035375
mtools: interprets SOURCE_DATE_EPOCH in system timezone instead of UTC
Reply or subscribe to this bug.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Chris Lamb <lamby@debian.org>:
Bug#1035375; Package mtools.
(Tue, 02 May 2023 11:03:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Alper Nebi Yasak <alpernebiyasak@gmail.com>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Chris Lamb <lamby@debian.org>.
(Tue, 02 May 2023 11:03:03 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
Package: mtools
Version: 4.0.33-1+really4.0.32-1
Severity: wishlist
User: reproducible-builds@lists.alioth.debian.org
Usertags: timestamps toolchain
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org
Hi,
I came across timestamp differences in FAT filesystem images while
trying to build debian-installer with debrepro (among many other
things), and tracked it down to mmd/mcopy calls. Here's a short reproducer:
export SOURCE_DATE_EPOCH="$(date "+%s")"
imgprep() {
[ -f "$1" ] && rm "$1"
mkfs.msdos --invariant -v -i deb00001 -C "$1" 512
mmd -i "$1" ::foo
mcopy -i "$1" "$2" ::bar
}
dd if=/dev/random of=rand.img bs=512 count=200
TZ=UTC imgprep first.img rand.img
TZ=UTC-3 imgprep second.img rand.img
diffoscope first.img second.img
which shows an exact 3-hour difference in timestamps for me. AFAICT,
SOURCE_DATE_EPOCH is meant to be in UTC, so embedded timestamps and the
two files should be the same regardless of TZ or system timezone.
Information forwarded
to debian-bugs-dist@lists.debian.org, Chris Lamb <lamby@debian.org>:
Bug#1035375; Package mtools.
(Tue, 02 May 2023 18:00:03 GMT) (full text, mbox, link).
Acknowledgement sent
to "Chris Lamb" <lamby@debian.org>:
Extra info received and forwarded to list. Copy sent to Chris Lamb <lamby@debian.org>.
(Tue, 02 May 2023 18:00:03 GMT) (full text, mbox, link).
Message #10 received at 1035375@bugs.debian.org (full text, mbox, reply):
tags 1035375 + patch
forwarded 1035375 https://lists.gnu.org/archive/html/info-mtools/2023-05/msg00000.html
thanks
Hi Alper,
> I came across timestamp differences in FAT filesystem images while
> trying to build debian-installer with debrepro (among many other
> things), and tracked it down to mmd/mcopy calls. Here's a short reproducer:
Ah, interesting! And your reproducer is extremely helpful, and
I've managed to put together a proof-of-concept patch:
--- 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
I've gone ahead and forwarded this to the mtools mailing list here:
https://lists.gnu.org/archive/html/info-mtools/2023-05/msg00000.html
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby@debian.org 🍥 chris-lamb.co.uk
`-
Added tag(s) patch.
Request was from "Chris Lamb" <lamby@debian.org>
to control@bugs.debian.org.
(Tue, 02 May 2023 18:00:04 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sat Aug 19 14:57:28 2023;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.