[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1035375: mtools: interprets SOURCE_DATE_EPOCH in system timezone instead of UTC



On 2023-05-02, Chris Lamb wrote:
>> 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

Did that get a response from upstream?

Seems like a simple patch with limited chance of introducing
problems... maybe a slightly more complicated veresion that only does
this when SOURCE_DATE_EPOCH is set.

Maybe it could be applied to the debian mtools package to at least give
it some real-world testing? :)

live well,
  vagrant

Attachment: signature.asc
Description: PGP signature


Reply to: