From 3e04718fa7ca93b2170d921f8e3876c524278210 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 9 Apr 2019 13:31:01 +0200 Subject: [PATCH] SSH client: close with terminal, fix anonymous authentication --- src/app/ssh_client/component.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app/ssh_client/component.cc b/src/app/ssh_client/component.cc index 076d02c..e697f44 100644 --- a/src/app/ssh_client/component.cc +++ b/src/app/ssh_client/component.cc @@ -102,7 +102,14 @@ struct Ssh_client::Main { Libc::with_libc([&] () { auto size = _terminal.size(); - ssh_channel_change_pty_size(_channel, size.columns(), size.lines()); + if (size.columns()*size.lines() == 0) { + /* shutdown if terminal is resized to zero */ + ssh_channel_close(_channel); + ssh_disconnect(_session); + _exit(0); + } else { + ssh_channel_change_pty_size(_channel, size.columns(), size.lines()); + } }); } @@ -226,6 +233,7 @@ struct Ssh_client::Main Genode::error("password authentication denied"); if (ssh_userauth_none(_session, NULL) == SSH_OK) { Genode::log("anonymous authentication successful"); + return; } _die();