diff -ur openssh-2.9p2-/Makefile.in openssh-2.9p2/Makefile.in
--- openssh-2.9p2-/Makefile.in	Wed Mar 21 03:12:12 2001
+++ openssh-2.9p2/Makefile.in	Thu Jun 28 20:11:02 2001
@@ -151,7 +151,7 @@
 distprep: catman-do
 	autoreconf
 
-install: manpages $(TARGETS) install-files host-key
+install: manpages $(TARGETS) install-files
 
 install-files:
 	$(srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
diff -ur openssh-2.9p2-/channels.c openssh-2.9p2/channels.c
--- openssh-2.9p2-/channels.c	Sat Mar 17 01:47:55 2001
+++ openssh-2.9p2/channels.c	Thu Jun 28 20:11:02 2001
@@ -1965,7 +1965,7 @@
 	char strport[NI_MAXSERV];
 	int gaierr, n, num_socks = 0, socks[NUM_SOCKS];
 	char display[512];
-	char hostname[MAXHOSTNAMELEN];
+	char hostname[401];	/* we only use the first 400 bytes anyway*/
 
 	for (display_number = x11_display_offset;
 	     display_number < MAX_DISPLAYS;
@@ -2037,7 +2037,8 @@
 	}
 
 	/* Set up a suitable value for the DISPLAY variable. */
-	if (gethostname(hostname, sizeof(hostname)) < 0)
+	if (gethostname(hostname, sizeof(hostname)) < 0
+	    && errno != ENAMETOOLONG)
 		fatal("gethostname: %.100s", strerror(errno));
 
 #ifdef IPADDR_IN_DISPLAY

diff -ur openssh-2.9p2-/session.c openssh-2.9p2/session.c
--- openssh-2.9p2-/session.c	Thu Jun 28 20:18:56 2001
+++ openssh-2.9p2/session.c	Thu Jun 28 20:11:02 2001
@@ -57,6 +57,7 @@
 #include "serverloop.h"
 #include "canohost.h"
 #include "session.h"
+#include "loginrec.h"
 
 #ifdef WITH_IRIX_PROJECT
 #include <proj.h>
@@ -685,7 +686,7 @@
 do_login(Session *s, const char *command)
 {
 	char *time_string;
-	char hostname[MAXHOSTNAMELEN];
+	char hostname[LINFO_HOSTSIZE];
 	socklen_t fromlen;
 	struct sockaddr_storage from;
 	time_t last_login_time;

diff -ur openssh-2.9p2-/ssh-keygen.c openssh-2.9p2/ssh-keygen.c
--- openssh-2.9p2-/ssh-keygen.c	Sun Mar 18 23:38:16 2001
+++ openssh-2.9p2/ssh-keygen.c	Thu Jun 28 20:11:03 2001
@@ -76,7 +76,7 @@
 char *__progname;
 #endif
 
-char hostname[MAXHOSTNAMELEN];
+char *hostname;
 
 void
 ask_filename(struct passwd *pw, const char *prompt)
@@ -649,10 +649,24 @@
 		printf("You don't exist, go away!\n");
 		exit(1);
 	}
-	if (gethostname(hostname, sizeof(hostname)) < 0) {
-		perror("gethostname");
-		exit(1);
-	}
+	{
+		size_t size = 100;
+		hostname = (char *)malloc(size);
+		while (hostname) {
+			if (gethostname(hostname, size) >= 0)
+				break;
+			if (errno != ENAMETOOLONG) {
+				perror("gethostname");
+				exit(1);
+			}
+			size <<= 1;
+			hostname = realloc(hostname, size);
+		}
+		if (hostname == NULL) {
+			perror("malloc");
+			exit(1);
+		}
+	} 
 
 	while ((opt = getopt(ac, av, "dqpclBRxXyb:f:t:P:N:C:")) != -1) {
 		switch (opt) {
diff -ur openssh-2.9p2-/sshd.c openssh-2.9p2/sshd.c
--- openssh-2.9p2-/sshd.c	Mon Mar 19 12:36:20 2001
+++ openssh-2.9p2/sshd.c	Thu Jun 28 20:11:03 2001
@@ -70,6 +70,7 @@
 #include "canohost.h"
 #include "auth.h"
 #include "misc.h"
+#include "loginrec.h"
 
 #ifdef LIBWRAP
 #include <tcpd.h>
