From: Damien Miller Date: Tue, 6 Apr 2021 22:20:35 +0000 (+1000) Subject: wrap getrlimit call in HAVE_GETRLIMIT; bz3291 X-Git-Tag: V_8_6_P1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f283a6c2e0a9bd9369e18462acd00be56fbe5b0d;p=thirdparty%2Fopenssh-portable.git wrap getrlimit call in HAVE_GETRLIMIT; bz3291 --- diff --git a/sftp-server.c b/sftp-server.c index cce52dbc2..1f9997bde 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -1495,8 +1495,10 @@ process_extended_limits(u_int32_t id) debug("request %u: limits", id); +#ifdef HAVE_GETRLIMIT if (getrlimit(RLIMIT_NOFILE, &rlim) != -1 && rlim.rlim_cur > 5) nfiles = rlim.rlim_cur - 5; /* stdio(3) + syslog + spare */ +#endif if ((msg = sshbuf_new()) == NULL) fatal_f("sshbuf_new failed");