openssh portable on FreeBSD i386
Todd C. Miller
Todd.Miller at sudo.ws
Fri Jun 2 03:03:46 AEST 2023
On Thu, 01 Jun 2023 18:50:42 +0200, Thorsten Glaser wrote:
> For OpenSSH itself, sure. For portable OpenSSH that’s not an option;
> time_t can be unsigned, signed, or even float.
>
> Another option would be to make the variable also time_t, but that
> would waste much space on contemporary platforms due to Y2038, so
> I think that, here, the cast is better.
POSIX stopped allowing time_t to be floating point some time ago
(and I don't think anyone ever implemented it that way) but that
is completely irrelevant to the diff at hand.
Even if time_t was unsigned, this would not be a problem for the
comparison in question. The result of "c->lastused + c->inactive_deadline"
would be unsigned if time_t is unsigned so there is no need to cast
c->inactive_deadline that I can see.
- todd
More information about the openssh-unix-dev
mailing list