git: setutxdb(3): Support UTX_DB_LASTLOGX to read last login records

Aaron LI aly at crater.dragonflybsd.org
Mon Oct 12 02:02:49 PDT 2026


commit 8010ac5c6f8ed9aa37bf2c51517a842263897159
Author: Aaron LI <aly at aaronly.me>
Date:   Mon Oct 12 16:54:55 2026 +0800

    setutxdb(3): Support UTX_DB_LASTLOGX to read last login records
    
    Before this fix, setutxdb(3) returned EINVAL for choosing
    UTX_DB_LASTLOGX, so getutxuser() was unable to get last login records
    from the lastlogx(5) database.  This exact problem caused sshd(8)
    failing to print the 'Last login' message on login.
    
    Fix setutxdb(3) to support UTX_DB_LASTLOGX.  Note that the lastlogx(5)
    database is a Berkeley DB hash keyed by uid and uses the 'lastlogx'
    struct.
    
    Assisted-by: DeepSeek-v4.1-flash (with Pi Coding Agent)

Summary of changes:
 lib/libc/gen/endutxent.3 |  31 ++++++++----
 lib/libc/gen/utmpx.c     | 119 ++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 123 insertions(+), 27 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8010ac5c6f8ed9aa37bf2c51517a842263897159


-- 
DragonFly BSD source repository


More information about the Commits mailing list