- (djm) OpenBSD CVS Sync

- djm@cvs.openbsd.org 2003/11/23 23:17:34
     [ssh-keyscan.c]
     from portable - use sysconf to detect fd limit; ok markus@
     (tidy diff by adding SSH_SSFDMAX macro to defines.h)
This commit is contained in:
Damien Miller 2003-11-24 13:07:45 +11:00
parent 927f52783e
commit e00074a726
3 changed files with 17 additions and 6 deletions

View File

@ -1,6 +1,11 @@
20031123 20031123
- (djm) [canohost.c] Move IPv4inV6 mapped address normalisation to its own - (djm) [canohost.c] Move IPv4inV6 mapped address normalisation to its own
function and call it unconditionally function and call it unconditionally
- (djm) OpenBSD CVS Sync
- djm@cvs.openbsd.org 2003/11/23 23:17:34
[ssh-keyscan.c]
from portable - use sysconf to detect fd limit; ok markus@
(tidy diff by adding SSH_SSFDMAX macro to defines.h)
20031122 20031122
- (dtucker) [channels.c] Make AIX write limit code clearer. Suggested by djm@ - (dtucker) [channels.c] Make AIX write limit code clearer. Suggested by djm@
@ -1514,4 +1519,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au Report from murple@murple.net, diagnosis from dtucker@zip.com.au
$Id: ChangeLog,v 1.3126 2003/11/24 01:57:25 djm Exp $ $Id: ChangeLog,v 1.3127 2003/11/24 02:07:45 djm Exp $

View File

@ -25,7 +25,7 @@
#ifndef _DEFINES_H #ifndef _DEFINES_H
#define _DEFINES_H #define _DEFINES_H
/* $Id: defines.h,v 1.104 2003/11/21 12:48:55 djm Exp $ */ /* $Id: defines.h,v 1.105 2003/11/24 02:07:46 djm Exp $ */
/* Constants */ /* Constants */
@ -529,6 +529,14 @@ struct winsize {
# define krb5_get_err_text(context,code) error_message(code) # define krb5_get_err_text(context,code) error_message(code)
#endif #endif
/* Maximum number of file descriptors available */
#ifdef HAVE_SYSCONF
# define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX)
#else
# define SSH_SYSFDMAX 10000
#endif
/* /*
* Define this to use pipes instead of socketpairs for communicating with the * Define this to use pipes instead of socketpairs for communicating with the
* client program. Socketpairs do not seem to work on all systems. * client program. Socketpairs do not seem to work on all systems.

View File

@ -214,13 +214,11 @@ fdlim_get(int hard)
if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0) if (getrlimit(RLIMIT_NOFILE, &rlfd) < 0)
return (-1); return (-1);
if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY) if ((hard ? rlfd.rlim_max : rlfd.rlim_cur) == RLIM_INFINITY)
return 10000; return SSH_SYSFDMAX;
else else
return hard ? rlfd.rlim_max : rlfd.rlim_cur; return hard ? rlfd.rlim_max : rlfd.rlim_cur;
#elif defined (HAVE_SYSCONF)
return sysconf (_SC_OPEN_MAX);
#else #else
return 10000; return SSH_SYSFDMAX;
#endif #endif
} }