:: Re: [DNG] 64-bit time in new wtmp l…
Top Page
Delete this message
Reply to this message
Author: Olaf Meeuwissen
Date:  
To: Lars Noodén
CC: dng
Subject: Re: [DNG] 64-bit time in new wtmp logs on Excalibur
Lars Noodén via Dng <dng@???> writes:

> I think this is upstream from Devuan, but wtmp on Excalibur is now in
> SQLite3 format with an integer which might be 64-bit time:
>
> sqlite3 /var/log/wtmp.db
>
> sqlite> SELECT User, max(Login) FROM wtmp WHERE User='lars';
> lars|1785111082567371
>
> sqlite> .schema
> CREATE TABLE wtmp(ID INTEGER PRIMARY KEY, Type INTEGER, User TEXT NOT
> NULL, Login INTEGER, Logout INTEGER, TTY TEXT, RemoteHost TEXT,
> Service TEXT) STRICT;
>
> The built-in datetime() function for SQLite3 does not handle that
> integer as a date-time because it is clearly not a UNIX Epoch.


Based on the output of `date +%s`, I'd say it's a UNIX Epoch in
microseconds.

> Also, the manual page for wtmp(5) for the login records seems to have
> information about the old format only and does not even mention the
> file wtmp.db.
>
> How should that integer be processed to produce a human-readable date-time?


Hope this helps,
--
Olaf Meeuwissen