[openssh-commits] [openssh] branch master updated: Improve DragonFly BSD support

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Nov 6 20:45:51 AEDT 2026


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

The following commit(s) were added to refs/heads/master by this push:
     new 5dba72ada Improve DragonFly BSD support
5dba72ada is described below

commit 5dba72adacbd39736960543373737bc01e35f778
Author: Aaron LI <aly at aaronly.me>
AuthorDate: Fri Nov 6 12:47:00 2026 +0800

    Improve DragonFly BSD support
    
    * Add <net/tun/if_tun.h> header detection and update
      openbsd-compat/port-net.c to use it.
    * Define LOCKED_PASSWD_PREFIX, SSH_TUN_FREEBSD and SSH_TUN_COMPAT_AF for
      DragonFly, similar to FreeBSD.
    * Set SKIP_DISABLE_LASTLOG_DEFINE=yes to avoid disabling lastlog
      support.
    * Add -DUTXDB_LASTLOGIN=UTX_DB_LASTLOGX to CFLAGS to tell setutxdb() to
      use the correct lastlog database.
---
 configure.ac              | 12 ++++++++++++
 openbsd-compat/port-net.c |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/configure.ac b/configure.ac
index 19cb23331..7769d6bbb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -488,6 +488,7 @@ AC_CHECK_HEADERS([ \
 	maillock.h \
 	ndir.h \
 	net/if_tun.h \
+	net/tun/if_tun.h \
 	netdb.h \
 	pam/pam_appl.h \
 	pty.h \
@@ -863,6 +864,15 @@ int main(void) { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
 *-*-dragonfly*)
 	SSHDLIBS="$SSHDLIBS"
 	TEST_MALLOC_OPTIONS="AFGJPRX"
+	AC_DEFINE([LOCKED_PASSWD_PREFIX], ["*LOCKED*"], [Account locked with pw(1)])
+	AC_DEFINE([SSH_TUN_FREEBSD], [1], [Open tunnel devices the FreeBSD way])
+	AC_DEFINE([SSH_TUN_COMPAT_AF], [1],
+	    [Use tunnel device compatibility to OpenBSD])
+	# DragonFly doesn't have "struct lastlog" but supports utmpx similar to
+	# FreeBSD.
+	SKIP_DISABLE_LASTLOG_DEFINE=yes
+	# DragonFly uses UTX_DB_LASTLOGX for setutxdb() to get lastlog entries.
+	CFLAGS="$CFLAGS -DUTXDB_LASTLOGIN=UTX_DB_LASTLOGX"
 	;;
 *-*-haiku*)
 	LIBS="$LIBS -lbsd "
@@ -5739,7 +5749,9 @@ dnl wtmpx detection
 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
+#ifdef HAVE_UTMP_H
 #include <utmp.h>
+#endif
 #ifdef HAVE_UTMPX_H
 #include <utmpx.h>
 #endif
diff --git a/openbsd-compat/port-net.c b/openbsd-compat/port-net.c
index 198e73f0d..edfe783b5 100644
--- a/openbsd-compat/port-net.c
+++ b/openbsd-compat/port-net.c
@@ -204,6 +204,9 @@ sys_tun_open(int tun, int mode, char **ifname)
 #ifdef HAVE_NET_IF_TUN_H
 #include <net/if_tun.h>
 #endif
+#ifdef HAVE_NET_TUN_IF_TUN_H
+#include <net/tun/if_tun.h>
+#endif
 
 int
 sys_tun_open(int tun, int mode, char **ifname)

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list