mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-10 07:19:23 +01:00
add new channel after authentication
With libssh commit 8a885f0b ("channels: Add check if we are authenticated before we create a channel") connection fails if channel is added before successful authentication. So add the channel after authentication. Fixes #154
This commit is contained in:
parent
fd4ac27d59
commit
299c7c670c
@ -241,12 +241,6 @@ static void on_ssh_client_event(struct tmate_ssh_client *client)
|
||||
|
||||
ssh_set_callbacks(session, &client->ssh_callbacks);
|
||||
|
||||
client->channel = channel = ssh_channel_new(session);
|
||||
if (!channel) {
|
||||
tmate_fatal("cannot initialize");
|
||||
return;
|
||||
}
|
||||
|
||||
ssh_set_blocking(session, 0);
|
||||
ssh_options_set(session, SSH_OPTIONS_HOST, client->server_ip);
|
||||
ssh_options_set(session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity);
|
||||
@ -370,6 +364,12 @@ static void on_ssh_client_event(struct tmate_ssh_client *client)
|
||||
case SSH_AUTH_SUCCESS:
|
||||
tmate_debug("Auth successful");
|
||||
client->state = SSH_OPEN_CHANNEL;
|
||||
|
||||
client->channel = channel = ssh_channel_new(session);
|
||||
if (!channel) {
|
||||
tmate_fatal("cannot initialize");
|
||||
return;
|
||||
}
|
||||
/* fall through */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user