summaryrefslogtreecommitdiff
path: root/system/openssh/fix-utmpx.patch
diff options
context:
space:
mode:
Diffstat (limited to 'system/openssh/fix-utmpx.patch')
-rw-r--r--system/openssh/fix-utmpx.patch45
1 files changed, 43 insertions, 2 deletions
diff --git a/system/openssh/fix-utmpx.patch b/system/openssh/fix-utmpx.patch
index d04742e2f..fd33b761c 100644
--- a/system/openssh/fix-utmpx.patch
+++ b/system/openssh/fix-utmpx.patch
@@ -1,5 +1,46 @@
---- openssh-7.7p1/loginrec.c.old 2018-04-02 00:38:28.000000000 -0500
-+++ openssh-7.7p1/loginrec.c 2018-06-15 22:09:00.091482769 -0500
+diff -rNU3 openssh-9.4p1.old/loginrec.c openssh-9.4p1/loginrec.c
+--- openssh-9.4p1.old/loginrec.c 2023-08-10 01:10:22.000000000 +0000
++++ openssh-9.4p1/loginrec.c 2024-12-08 04:52:39.040018859 +0000
+@@ -741,7 +741,7 @@
+ void
+ construct_utmpx(struct logininfo *li, struct utmpx *utx)
+ {
+-# ifdef HAVE_ADDR_V6_IN_UTMP
++# ifdef HAVE_ADDR_V6_IN_UTMPX
+ struct sockaddr_in6 *sa6;
+ # endif
+ memset(utx, '\0', sizeof(*utx));
+@@ -763,10 +763,6 @@
+ set_utmpx_time(li, utx);
+ utx->ut_pid = li->pid;
+
+- /* strncpy(): Don't necessarily want null termination */
+- strncpy(utx->ut_user, li->username,
+- MIN_SIZEOF(utx->ut_user, li->username));
+-
+ if (li->type == LTYPE_LOGOUT)
+ return;
+
+@@ -775,6 +771,10 @@
+ * for logouts.
+ */
+
++ /* strncpy(): Don't necessarily want null termination */
++ strncpy(utx->ut_user, li->username,
++ MIN_SIZEOF(utx->ut_user, li->username));
++
+ # ifdef HAVE_HOST_IN_UTMPX
+ strncpy(utx->ut_host, li->hostname,
+ MIN_SIZEOF(utx->ut_host, li->hostname));
+@@ -787,7 +787,7 @@
+ if (li->hostaddr.sa.sa_family == AF_INET)
+ utx->ut_addr = li->hostaddr.sa_in.sin_addr.s_addr;
+ # endif
+-# ifdef HAVE_ADDR_V6_IN_UTMP
++# ifdef HAVE_ADDR_V6_IN_UTMPX
+ /* this is just a 128-bit IPv6 address */
+ if (li->hostaddr.sa.sa_family == AF_INET6) {
+ sa6 = ((struct sockaddr_in6 *)&li->hostaddr.sa);
@@ -1663,7 +1663,11 @@
const char *ttyn)
{