diff options
author | kim <kim> | 1998-09-10 16:36:11 +0000 |
---|---|---|
committer | kim <kim> | 1998-09-10 16:36:11 +0000 |
commit | 3f17d1c6e2438111e7fc84d024ba51ac27c64104 (patch) | |
tree | 23890eb5a83605387bdd394d7c1a178295c13c5e /security | |
parent | 40bc4e32efa88a597cfb9cf591f0e8fb7afd64fa (diff) | |
download | pkgsrc-3f17d1c6e2438111e7fc84d024ba51ac27c64104.tar.gz |
Don't write truncated hostnames in utmp, use IP addresses instead.
Don't immediately timeout sessions as idle just because an actual
idle check had not been done yet (so last_idle_time was zero, and
the difference to current time is way over your idle time limit).
Also added the first US mirror of ssh into MASTER_SITES.
Diffstat (limited to 'security')
-rw-r--r-- | security/ssh/Makefile | 5 | ||||
-rw-r--r-- | security/ssh/patches/patch-au | 58 | ||||
-rw-r--r-- | security/ssh/patches/patch-av | 13 |
3 files changed, 74 insertions, 2 deletions
diff --git a/security/ssh/Makefile b/security/ssh/Makefile index cf839fd2fea..206f5eef667 100644 --- a/security/ssh/Makefile +++ b/security/ssh/Makefile @@ -1,11 +1,12 @@ -# $NetBSD: Makefile,v 1.33 1998/08/20 15:17:25 tsarna Exp $ +# $NetBSD: Makefile,v 1.34 1998/09/10 16:36:11 kim Exp $ # FreeBSD Id: Makefile,v 1.47 1997/11/10 22:04:42 dima Exp # DISTNAME= ssh-1.2.26 CATEGORIES= security net MASTER_SITES= ftp://ftp.cs.hut.fi/pub/ssh/ \ - ftp://ftp.funet.fi/pub/unix/security/login/ssh/ + ftp://ftp.funet.fi/pub/unix/security/login/ssh/ \ + ftp://ftp.gw.com/pub/unix/ssh/ MAINTAINER= tron@netbsd.org HOMEPAGE= http://www.cs.hut.fi/ssh/ diff --git a/security/ssh/patches/patch-au b/security/ssh/patches/patch-au new file mode 100644 index 00000000000..12db11f7683 --- /dev/null +++ b/security/ssh/patches/patch-au @@ -0,0 +1,58 @@ +$NetBSD: patch-au,v 1.1 1998/09/10 16:36:12 kim Exp $ + +--- login.c.orig Tue Jan 20 07:24:05 1998 ++++ login.c Tue Feb 24 09:43:51 1998 +@@ -227,6 +227,19 @@ + struct utmp u, u2; + off_t offset; + const char *utmp, *wtmp; ++#if defined(HAVE_HOST_IN_UTMP) || defined(HAVE_LASTLOG_H) || defined(HAVE_LASTLOG) ++ char myname[MAXHOSTNAMELEN]; ++ char shost[MAXHOSTNAMELEN]; ++ char *p = NULL, *q = NULL; ++ ++ memset(shost, 0, sizeof(shost)); ++ gethostname(myname, MAXHOSTNAMELEN); ++ if (((p = memchr(myname, '.', MAXHOSTNAMELEN)) != NULL) ++ && ((q = strchr(host, '.')) != NULL) ++ && (strncmp(p, q, MAXHOSTNAMELEN - (p - myname)) == 0)) { ++ strncpy(shost, host, q - host); ++ } ++#endif + + /* Construct an utmp/wtmp entry. */ + memset(&u, 0, sizeof(u)); +@@ -257,12 +270,14 @@ + strncpy(u.ut_user, user, sizeof(u.ut_user)); + #endif /* HAVE_NAME_IN_UTMP */ + #ifdef HAVE_HOST_IN_UTMP +- strncpy(u.ut_host, host, sizeof(u.ut_host)); +-#ifdef __FreeBSD__ +- if (strlen(host) > sizeof(u.ut_host)) { ++ if ((*shost != '\0') && (strlen(shost) <= sizeof(u.ut_host))) ++ strncpy(u.ut_host, shost, sizeof(u.ut_host)); ++#ifndef HAVE_ADDR_IN_UTMP ++ else if (strlen(host) > sizeof(u.ut_host)) + strncpy(u.ut_host, get_remote_ipaddr(), sizeof(u.ut_host)); +- } +-#endif /* __FreeBSD__ */ ++#endif /* HAVE_ADDR_IN_UTMP */ ++ else ++ strncpy(u.ut_host, host, sizeof(u.ut_host)); + #endif /* HAVE_HOST_IN_UTMP */ + #ifdef HAVE_ADDR_IN_UTMP + if (addr) +@@ -431,7 +446,12 @@ + /* Update lastlog. */ + ll.ll_time = time(NULL); + strncpy(ll.ll_line, ttyname + 5, sizeof(ll.ll_line)); +- strncpy(ll.ll_host, host, sizeof(ll.ll_host)); ++ if ((*shost != '\0') && (strlen(shost) <= sizeof(ll.ll_host))) ++ strncpy(ll.ll_host, shost, sizeof(ll.ll_host)); ++ else if (strlen(host) > sizeof(ll.ll_host)) ++ strncpy(ll.ll_host, get_remote_ipaddr(), sizeof(ll.ll_host)); ++ else ++ strncpy(ll.ll_host, host, sizeof(ll.ll_host)); + #ifdef LASTLOG_IS_DIR + sprintf(lastlogfile, "%.100s/%.100s", lastlog, user); + fd = open(lastlogfile, O_WRONLY | O_CREAT, 0644); diff --git a/security/ssh/patches/patch-av b/security/ssh/patches/patch-av new file mode 100644 index 00000000000..c193637255a --- /dev/null +++ b/security/ssh/patches/patch-av @@ -0,0 +1,13 @@ +$NetBSD: patch-av,v 1.1 1998/09/10 16:36:12 kim Exp $ + +--- serverloop.c.orig Wed Jul 8 12:40:38 1998 ++++ serverloop.c Thu Sep 10 12:13:33 1998 +@@ -441,7 +441,7 @@ + if (ret == 0) /* Nothing read, timeout expired */ + { + /* Check if idle_timeout expired ? */ +- if (idle_timeout != 0 && !child_terminated && ++ if (idle_timeout != 0 && !child_terminated && idle_time_last && + time(NULL) - idle_time_last > idle_timeout) + { + /* Yes, kill the child */ |