[openssh-commits] [openssh] 01/01: support NetBSD's utmpx.ut_ss address field

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Aug 5 08:59:28 AEST 2020


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

djm pushed a commit to branch master
in repository openssh.

commit ea1f649046546a860f68b97ddc3015b7e44346ca
Author: Damien Miller <djm at mindrot.org>
Date:   Wed Aug 5 08:58:57 2020 +1000

    support NetBSD's utmpx.ut_ss address field
    
    bz#960, ok dtucker
---
 configure.ac | 1 +
 loginrec.c   | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/configure.ac b/configure.ac
index 0a2eb044..33a82814 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4207,6 +4207,7 @@ OSSH_CHECK_HEADER_FOR_FIELD([ut_exit], [utmp.h], [HAVE_EXIT_IN_UTMP])
 OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmp.h], [HAVE_TIME_IN_UTMP])
 OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX])
 OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX])
+OSSH_CHECK_HEADER_FOR_FIELD([ut_ss], [utmpx.h], [HAVE_SS_IN_UTMPX])
 
 AC_CHECK_MEMBERS([struct stat.st_blksize])
 AC_CHECK_MEMBERS([struct stat.st_mtim])
diff --git a/loginrec.c b/loginrec.c
index e5289deb..ea058fd6 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -778,6 +778,9 @@ construct_utmpx(struct logininfo *li, struct utmpx *utx)
 	strncpy(utx->ut_host, li->hostname,
 	    MIN_SIZEOF(utx->ut_host, li->hostname));
 # endif
+# ifdef HAVE_SS_IN_UTMPX
+	utx->ut_ss = li->hostaddr.sa_storage;
+# endif
 # ifdef HAVE_ADDR_IN_UTMPX
 	/* this is just a 32-bit IP address */
 	if (li->hostaddr.sa.sa_family == AF_INET)

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


More information about the openssh-commits mailing list