SSH client: close with terminal, fix anonymous authentication

This commit is contained in:
Emery Hemingway
2019-04-09 13:31:01 +02:00
parent 267327664a
commit 3e04718fa7

View File

@@ -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();