aboutsummaryrefslogtreecommitdiffstats
path: root/security/ssh2
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1996-06-18 00:14:19 +0800
committerache <ache@FreeBSD.org>1996-06-18 00:14:19 +0800
commit88f04a19c798540dd37be901bba4b142cb3a2105 (patch)
tree741995cec285bed76ee7de96b4107e1b6faf74d8 /security/ssh2
parentc7b9003963c8f14e33db44452f2a5c74b6a6e306 (diff)
downloadfreebsd-ports-graphics-88f04a19c798540dd37be901bba4b142cb3a2105.tar.gz
freebsd-ports-graphics-88f04a19c798540dd37be901bba4b142cb3a2105.tar.zst
freebsd-ports-graphics-88f04a19c798540dd37be901bba4b142cb3a2105.zip
If hostname > UT_HOSTSIZE, write its numeric address instead to keep
valid information in utmp and lastlog
Diffstat (limited to 'security/ssh2')
-rw-r--r--security/ssh2/files/patch-ac24
1 files changed, 24 insertions, 0 deletions
diff --git a/security/ssh2/files/patch-ac b/security/ssh2/files/patch-ac
new file mode 100644
index 00000000000..7701a515af2
--- /dev/null
+++ b/security/ssh2/files/patch-ac
@@ -0,0 +1,24 @@
+*** login.c.bak Thu Jun 6 15:39:34 1996
+--- login.c Mon Jun 17 19:56:43 1996
+***************
+*** 236,241 ****
+--- 236,254 ----
+ strncpy(u.ut_user, user, sizeof(u.ut_user));
+ #endif /* HAVE_NAME_IN_UTMP */
+ #ifdef HAVE_HOST_IN_UTMP
++ #ifdef __FreeBSD__
++ if (strlen(host) > UT_HOSTSIZE) {
++ struct hostent *hp = gethostbyname(host);
++
++ if (hp != NULL) {
++ struct in_addr in;
++
++ memmove(&in, hp->h_addr, sizeof(in));
++ host = inet_ntoa(in);
++ } else
++ host = "invalid hostname";
++ }
++ #endif
+ strncpy(u.ut_host, host, sizeof(u.ut_host));
+ #endif /* HAVE_HOST_IN_UTMP */
+ #ifdef HAVE_ADDR_IN_UTMP