Bug 1732 - Proper utmpx support for FreeBSD HEAD
Summary: Proper utmpx support for FreeBSD HEAD
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 5.4p1
Hardware: Other FreeBSD
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_5
  Show dependency treegraph
 
Reported: 2010-03-06 22:00 AEDT by Ed Schouten
Modified: 2010-04-16 15:50 AEST (History)
1 user (show)

See Also:


Attachments
OpenSSH + FreeBSD's utmpx (4.30 KB, patch)
2010-03-06 22:00 AEDT, Ed Schouten
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Schouten 2010-03-06 22:00:08 AEDT
Created attachment 1805 [details]
OpenSSH + FreeBSD's utmpx

In order to make utmpx logging and lastlog information work on FreeBSD HEAD, the attached patch is required. FreeBSD's <utmpx.h> doesn't declare all sorts of path name definitions. Its lastlog interface is also part of the utmpx API itself.
Comment 1 Damien Miller 2010-03-26 10:59:57 AEDT
Comment on attachment 1805 [details]
OpenSSH + FreeBSD's utmpx

>-
>-dnl utmpx detection - I don't know any system so perverse as to require
>-dnl  utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
>-dnl  there, though.
>-AC_MSG_CHECKING([if your system defines UTMPX_FILE])
>-AC_TRY_COMPILE([
>-#include <sys/types.h>
>-#include <utmp.h>
>-#ifdef HAVE_UTMPX_H
>-#include <utmpx.h>
>-#endif
>-#ifdef HAVE_PATHS_H
>-#  include <paths.h>
>-#endif
>-	],
>-	[ char *utmpx = UTMPX_FILE; ],
>-	[ AC_MSG_RESULT(yes) ],
>-	[ AC_MSG_RESULT(no)
>-	  system_utmpx_path=no ]
>-)
>-if test -z "$conf_utmpx_location"; then
>-	if test x"$system_utmpx_path" = x"no" ; then
>-		AC_DEFINE(DISABLE_UTMPX)
>-	fi
>-else
>-	AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location",
>-		[Define if you want to specify the path to your utmpx file])
>-fi

Why are you deleting this section? This might affect platforms other than FreeBSD.
Comment 2 Ed Schouten 2010-03-26 18:26:15 AEDT
I am quite sure that this won't cause any breakage. As long as the implementation provides the utmpx structure and the functions required by POSIX, why shouldn't we use it then?

FreeBSD's <utmpx.h> doesn't provide the *TMPX_FILE definitions which are present in other implementations for two reasons:

- It is not standardized by POSIX.
- I never want applications to access the utmpx files manually.
Comment 3 Darren Tucker 2010-04-09 12:20:46 AEST
(In reply to comment #2)
> I am quite sure that this won't cause any breakage. As long as the
> implementation provides the utmpx structure and the functions required
> by POSIX, why shouldn't we use it then?

but your change also disables the setting of CONF_UTMPX_FILE based on anything that sets conf_utmpx_location (which seems to include at least the netbsd pkgsrc package).

That said, nothing in our code actually uses CONF_UTMPX_FILE, so maybe it doesn't matter (any more?)
Comment 4 Ed Schouten 2010-04-09 17:32:25 AEST
(In reply to comment #3)
> That said, nothing in our code actually uses CONF_UTMPX_FILE, so maybe
> it doesn't matter (any more?)

Exactly!
Comment 5 Darren Tucker 2010-04-09 18:15:18 AEST
OK, sold!  Thanks for the patch, it has been applied and will be in 5.5p1.
Comment 6 Damien Miller 2010-04-16 15:50:32 AEST
Mass move of bugs RESOLVED->CLOSED following the release of openssh-5.5p1