From 88f04a19c798540dd37be901bba4b142cb3a2105 Mon Sep 17 00:00:00 2001 From: ache Date: Mon, 17 Jun 1996 16:14:19 +0000 Subject: If hostname > UT_HOSTSIZE, write its numeric address instead to keep valid information in utmp and lastlog --- security/ssh/files/patch-ac | 24 ++++++++++++++++++++++++ security/ssh2/files/patch-ac | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 security/ssh/files/patch-ac create mode 100644 security/ssh2/files/patch-ac (limited to 'security') diff --git a/security/ssh/files/patch-ac b/security/ssh/files/patch-ac new file mode 100644 index 0000000..7701a51 --- /dev/null +++ b/security/ssh/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 diff --git a/security/ssh2/files/patch-ac b/security/ssh2/files/patch-ac new file mode 100644 index 0000000..7701a51 --- /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 -- cgit v1.1