channels: Add check if we are authenticated before we create a channel
Fixes T139 Reported-by: Jan Pazdziora <jpazdziora@redhat.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Этот коммит содержится в:
родитель
c4348c7b3c
Коммит
8a885f0bd3
@ -85,6 +85,11 @@ ssh_channel ssh_channel_new(ssh_session session)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if we have an authenticated session */
|
||||||
|
if (!(session->flags & SSH_SESSION_FLAG_AUTHENTICATED)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
channel = calloc(1, sizeof(struct ssh_channel_struct));
|
channel = calloc(1, sizeof(struct ssh_channel_struct));
|
||||||
if (channel == NULL) {
|
if (channel == NULL) {
|
||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user