diff options
author | Andreas Gunnarsson <andreas@cvs.openbsd.org> | 2009-05-27 06:33:40 +0000 |
---|---|---|
committer | Andreas Gunnarsson <andreas@cvs.openbsd.org> | 2009-05-27 06:33:40 +0000 |
commit | 681bd4714b043765f96d9d93f118f0cde4ae7757 (patch) | |
tree | 837ad2e838c1267f91927c70bd7c95679aab8002 | |
parent | 76407c2cf724b345d8011808efe244b6aaa81a83 (diff) |
Send SSH2_MSG_DISCONNECT when the client disconnects. From a larger
change from Martin Forssen, maf at appgate dot com.
ok markus@
-rw-r--r-- | usr.bin/ssh/clientloop.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index 8a59902a1ac..9f4379d484a 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.210 2009/05/25 06:48:01 andreas Exp $ */ +/* $OpenBSD: clientloop.c,v 1.211 2009/05/27 06:33:39 andreas Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1464,6 +1464,12 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) /* Stop watching for window change. */ signal(SIGWINCH, SIG_DFL); + packet_start(SSH2_MSG_DISCONNECT); + packet_put_int(SSH2_DISCONNECT_BY_APPLICATION); + packet_put_cstring("disconnected by user"); + packet_send(); + packet_write_wait(); + channel_free_all(); if (have_pty) |