Call for testing: OpenSSH-6.2

Dag-Erling Smørgrav des at
Thu Mar 7 22:41:10 EST 2013

Damien Miller <djm at> writes:
> What version of FreeBSD deprecated these? What is you host system type
> as reported by configure? I'll at least be able to add these to

We switched from utmp to utmpx in 9 on 2010-01-13.  FreeBSD 8 and older
still have utmp.  Any machine that at one point ran FreeBSD 8 or older,
or FreeBSD 9 prior to 2010-01-13, and has since then been upgraded to a
newer version of FreeBSD 9 or 10 is likely to have old log files lying
around even though the interfaces are no longer available.

The problem seems to be a combination of factors in and
defines.h which cause OpenSSH to attempt to use utmp / wtmp / lastlog
based solely on the existence of log files, even if it knows the API
functions are not available.

Let's look at lastlog, for instance.

 743: /* I hope that the presence of LASTLOG_FILE is enough to detect this */
 744: #if defined(LASTLOG_FILE) && !defined(DISABLE_LASTLOG)
 745: #  define USE_LASTLOG
 746: #endif

LASTLOG_FILE comes from _PATH_LASTLOG in <paths.h> or, if _PATH_LASTLOG
is not defined, from CONF_LASTLOG_FILE, which is the location of the
lastlog file which configure found.

DISABLE_LASTLOG is defined by configure if and only if at least one of
the following is true:

a) --disable-lastlog was specified on the command line
b) --with-lastlog=no was specified on the command line
c) there is no lastlog file in the expected location(s).

configure never checks whether struct lastlog is defined.  The easiest
solution would probably be to add something like this in,
around line 4300:

AC_CHECK_MEMBER([struct lastlog.ll_line], [], [
], [
#include <sys/types.h>
#include <utmp.h>

AC_CHECK_MEMBER([struct utmp.ut_line], [], [
], [
#include <sys/types.h>
#include <utmp.h>

On FreeBSD 10, this results in

% egrep "DISABLE_(LASTLOG|UTMP)" config.h
#define DISABLE_UTMP 1
/* #undef DISABLE_UTMPX */

One last nit is that the conf_lastlog_file logic runs regardless of
whether DISABLE_LASTLOG is defined, which is a waste of time.

The attached patch combines the DISABLE_{LASTLOG,UTMP,WTMP} logic above
with additional code to disable the log file search.

All tests pass on 8 and 9.  The test fails on 10 (both with
and without the patch), but that's likely to be a local issue.  I'll
have to re-run the tests in a clean environment.

Dag-Erling Smørgrav - des at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: openssh-lastlog.diff
Type: text/x-patch
Size: 5499 bytes
Desc: not available
URL: <>

More information about the openssh-unix-dev mailing list