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

Aaron LI aly at crater.dragonflybsd.org
Thu Nov 12 23:21:40 PST 2026


commit 8559dd9d8b5306d0f150ce6c021d755851d09d0e
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/8559dd9d8b5306d0f150ce6c021d755851d09d0e


-- 
DragonFly BSD source repository


More information about the Commits mailing list