Page MenuHomeFreeBSD

fattime: fix fattime to timespec conversion of dates beyond 2106-02-06
ClosedPublic

Authored by jeffpc_josefsipek.net on Apr 12 2024, 2:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 25 2024, 9:38 PM
Unknown Object (File)
Nov 15 2024, 8:53 PM
Unknown Object (File)
Nov 5 2024, 6:00 PM
Unknown Object (File)
Oct 2 2024, 6:44 PM
Unknown Object (File)
Oct 2 2024, 6:44 PM
Unknown Object (File)
Oct 2 2024, 6:44 PM
Unknown Object (File)
Oct 2 2024, 5:30 PM
Unknown Object (File)
Sep 18 2024, 1:22 PM
Subscribers

Details

Summary

It turns out that the only conversion issue was in fattime2timespec, where
multiplying the number of seconds in a day by the number of days overflowed
32-bit unsigned int for dates beyond 2106-02-07 06:28:15.

Casting one of the multiplicands as time_t forces a 64-bit multiplication on
systems where time_t is 64-bits and produces no binary changes on the one
remaining system with 32-bit time_t (namely i386).

Since the code is now tested & fixed, this change removes the fixme comments.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57045
Build 53933: arc lint + arc unit