infinite recursion in torsocks log timestamps
If libc calls
close in order to deal with time zones for
localtime, the torsocks interception of
close may lead to infinite recursion: torsocks
close tries to print a log message, which needs a timestamp, which it formats with
localtime, which opens the tz database and calls
close when done, which tries to print a log message, which needs a timestamp...
(NetBSD's libc is an example of such a libc. Note
gmtime has the same property.)
The attached patch changes timestamps to be seconds since epoch minus leap seconds, i.e. a standard POSIX clock, in order to avoid this recursion.