]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- djm@cvs.openbsd.org 2012/04/11 13:26:40
authorDamien Miller <djm@mindrot.org>
Sun, 22 Apr 2012 01:23:46 +0000 (11:23 +1000)
committerDamien Miller <djm@mindrot.org>
Sun, 22 Apr 2012 01:23:46 +0000 (11:23 +1000)
     [sshd.c]
     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
     while; ok deraadt@ markus@

ChangeLog
sshd.c

index 7cc597586f78a2a221ba55724e162f956f797d26..f58907574e25f72171fb9af1b3769210f7f30643 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      [auth.c]
      Support "none" as an argument for AuthorizedPrincipalsFile to indicate
      no file should be read.
+   - djm@cvs.openbsd.org 2012/04/11 13:26:40
+     [sshd.c]
+     don't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a
+     while; ok deraadt@ markus@
 
 20120420
  - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
diff --git a/sshd.c b/sshd.c
index b63aaa42818cd8d8f48da7dbd689bb058b840219..fddbc9d377120ae60c1c4b79cce5593235a41cb5 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.388 2011/09/30 21:22:49 djm Exp $ */
+/* $OpenBSD: sshd.c,v 1.389 2012/04/11 13:26:40 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1174,7 +1174,10 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
                        if (*newsock < 0) {
                                if (errno != EINTR && errno != EAGAIN &&
                                    errno != EWOULDBLOCK)
-                                       error("accept: %.100s", strerror(errno));
+                                       error("accept: %.100s",
+                                           strerror(errno));
+                               if (errno == EMFILE || errno == ENFILE)
+                                       usleep(100 * 1000);
                                continue;
                        }
                        if (unset_nonblock(*newsock) == -1) {