summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/serverloop.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-07-02 22:52:56 +0000
committermarkus <markus@openbsd.org>2001-07-02 22:52:56 +0000
commitc85b65722b226a1898a62d153f3199070bbd1583 (patch)
treef275535265d92ac7265f47fafce5203b77561d87 /usr.bin/ssh/serverloop.c
parentupdate for sectok.h interface changes. (diff)
downloadwireguard-openbsd-c85b65722b226a1898a62d153f3199070bbd1583.tar.xz
wireguard-openbsd-c85b65722b226a1898a62d153f3199070bbd1583.zip
improve cleanup/exit logic in ssh2:
stop listening to channels, detach channel users (e.g. sessions). wait for children (i.e. dying sessions), send exit messages, cleanup all channels.
Diffstat (limited to 'usr.bin/ssh/serverloop.c')
-rw-r--r--usr.bin/ssh/serverloop.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c
index c5ef95b7061..dea4fa2f215 100644
--- a/usr.bin/ssh/serverloop.c
+++ b/usr.bin/ssh/serverloop.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.73 2001/07/02 13:59:14 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.74 2001/07/02 22:52:57 markus Exp $");
#include "xmalloc.h"
#include "packet.h"
@@ -711,7 +711,8 @@ server_loop2(Authctxt *authctxt)
* there is a race between channel_free_all() killing children and
* children dying before kill()
*/
- channel_free_all();
+ channel_detach_all();
+ channel_stop_listening();
while (session_have_children()) {
pid = waitpid(-1, &status, 0);
@@ -722,6 +723,7 @@ server_loop2(Authctxt *authctxt)
break;
}
}
+ channel_free_all();
}
static void