Index: configure.in
===================================================================
RCS file: /cvs/openssh_cvs/configure.in,v
retrieving revision 1.206
diff -u -p -r1.206 configure.in
--- configure.in	2000/12/20 02:34:49	1.206
+++ configure.in	2000/12/21 14:57:30
@@ -304,7 +304,7 @@ fi
 AC_CHECK_HEADERS(bstring.h endian.h floatingpoint.h getopt.h lastlog.h limits.h login.h login_cap.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/queue.h sys/select.h sys/stat.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h sys/un.h stddef.h time.h ttyent.h usersec.h util.h utmp.h utmpx.h vis.h)
 
 dnl    Checks for library functions.
-AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getnameinfo getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strsep strtok_r vsnprintf vhangup vis waitpid _getpty __b64_ntop)
+AC_CHECK_FUNCS(arc4random atexit b64_ntop bcopy bindresvport_af clock fchmod freeaddrinfo futimes gai_strerror getcwd getaddrinfo getnameinfo getrlimit getrusage getttyent inet_aton inet_ntoa innetgr login_getcapbool md5_crypt memmove mkdtemp on_exit openpty realpath rresvport_af setdtablesize setenv seteuid setlogin setproctitle setreuid setrlimit setsid sigaction sigvec snprintf strerror strlcat strlcpy strsep strtok_r sysconf vsnprintf vhangup vis waitpid _getpty __b64_ntop)
 dnl    Checks for time functions
 AC_CHECK_FUNCS(gettimeofday time)
 dnl    Checks for libutil functions
Index: ssh-agent.c
===================================================================
RCS file: /cvs/openssh_cvs/ssh-agent.c,v
retrieving revision 1.40
diff -u -p -r1.40 ssh-agent.c
--- ssh-agent.c	2000/12/15 18:39:12	1.40
+++ ssh-agent.c	2000/12/21 14:57:31
@@ -674,7 +674,9 @@ main(int ac, char **av)
 	fd_set readset, writeset;
 	int sock, c_flag = 0, k_flag = 0, s_flag = 0, ch;
 	struct sockaddr_un sunaddr;
+#ifdef HAVE_SETRLIMIT
 	struct rlimit rlim;
+#endif
 	pid_t pid;
 	char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid];
 	extern int optind;
@@ -805,12 +807,14 @@ main(int ac, char **av)
 	close(1);
 	close(2);
 
+#ifdef HAVE_SETRLIMIT
 	/* deny core dumps, since memory contains unencrypted private keys */
 	rlim.rlim_cur = rlim.rlim_max = 0;
 	if (setrlimit(RLIMIT_CORE, &rlim) < 0) {
 		perror("setrlimit rlimit_core failed");
 		cleanup_exit(1);
 	}
+#endif
 	if (setsid() == -1) {
 		perror("setsid");
 		cleanup_exit(1);
Index: ssh-keyscan.c
===================================================================
RCS file: /cvs/openssh_cvs/ssh-keyscan.c,v
retrieving revision 1.6
diff -u -p -r1.6 ssh-keyscan.c
--- ssh-keyscan.c	2000/12/15 20:23:47	1.6
+++ ssh-keyscan.c	2000/12/21 14:57:32
@@ -183,6 +183,7 @@ getline(Linebuf * lb)
 static int
 fdlim_get(int hard)
 {
+#if defined(HAVE_GETRLIMIT)
 	struct rlimit rlfd;
 	if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
 		return (-1);
@@ -190,19 +191,30 @@ fdlim_get(int hard)
 		return 10000;
 	else
 		return hard ? rlfd.rlim_max : rlfd.rlim_cur;
+#elif defined (HAVE_SYSCONF)
+	return sysconf (_SC_OPEN_MAX);
+#else
+	return 10000;
+#endif
 }
 
 static int
 fdlim_set(int lim)
 {
+#if defined(HAVE_SETRLIMIT)
 	struct rlimit rlfd;
+#endif
 	if (lim <= 0)
 		return (-1);
+#if defined(HAVE_SETRLIMIT)
 	if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
 		return (-1);
 	rlfd.rlim_cur = lim;
 	if (setrlimit(RLIMIT_NOFILE, &rlfd) < 0)
 		return (-1);
+#elif defined (HAVE_SETDTABLESIZE)
+	setdtablesize (lim);
+#endif
 	return (0);
 }
 
