leosac / access-control

Leosac Access Control - Open Source Physical Access Control System
https://leosac.com
GNU Affero General Public License v3.0
242 stars 40 forks source link

Date conversion functions are broken on Raspberry PI #90

Closed xaqq closed 7 years ago

xaqq commented 7 years ago

Leosac uses date conversion functions to load / store validity information of various objects (for example Users and Credentials).

While thoses function work well with std::xxx_clock::time_point::max on a x64 system, they seems to have issue on Raspberry Pi. The validity-start and validity-end values, when reading a credential, are always incorrect.

This looks like a weird bug.

xaqq commented 7 years ago

The root cause seems be related to the size of std::time_t. It is 8 bytes on x64 while only 4 bytes on ARM. We need to find an other to convert date to string that avoid using std::time_t because it can be overflown too easily.