[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssh-unix-dev
Subject:    PrintLastLog fails on systems without lastlog but with utmpx
From:       Ed Maste <emaste () freebsd ! org>
Date:       2022-05-18 18:13:31
Message-ID: CAPyFy2AbXDo8Zk8qKZP-iHNkd7ksZ2NzkTu+nTK2ms+7SoDu0Q () mail ! gmail ! com
[Download RAW message or body]

From FreeBSD PR 209441. configure sets DISABLE_LASTLOG if we do not
have lastlog.ll_line:

AC_CHECK_MEMBER([struct lastlog.ll_line], [], [
    if test x$SKIP_DISABLE_LASTLOG_DEFINE != "xyes" ; then
        AC_DEFINE([DISABLE_LASTLOG])
    fi
        ], [

However DISABLE_LASTLOG disables support for PrintLastLog altogether
-- from servconf.c:

#ifdef DISABLE_LASTLOG
        { "printlastlog", sUnsupported, SSHCFG_GLOBAL },
#else
        { "printlastlog", sPrintLastLog, SSHCFG_GLOBAL },
#endif

In getlast_entry() DISABLE_LASTLOG disables use of wtmp and wtmpx, but
not utmpx. DISABLE_LASTLOG seems to be intended to mean disable last
login functionality altogether, and disable use of specifically
utmp/lastlog, in different locations.

It seems like (for consistency with --disable-utmp, --disable-utmpx,
--disable-wtmp, --disable-wtmpx) DISABLE_LASTLOG should refer only to
lastlog specifically, not last login functionality in general. Thus,
servconf should probably be:

#if defined(DISABLE_LASTLOG) && defined(DISABLE_UTMP) &&
defined(DISABLE_UTMPX) &&...
        { "printlastlog", sUnsupported, SSHCFG_GLOBAL },
#else
        { "printlastlog", sPrintLastLog, SSHCFG_GLOBAL },
#endif

and getlast_entry() should move the wtmp/wtmpx cases out of
!defined(DISABLE_LASTLOG).
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic