Commit 374fff92 authored by deuce's avatar deuce
Browse files

No matter the reason we don't get the channel type, still disconnect

the SSH session.  Also, do an INFO level log entry to indicate what
happened to your socket.
parent beb4dd20
......@@ -5438,19 +5438,12 @@ NO_SSH:
i=cryptGetAttributeString(sbbs->ssh_session, CRYPT_SESSINFO_SSH_CHANNEL_TYPE, tname, &tnamelen);
GCESS(i, client_socket, sbbs->ssh_session, "getting channel type");
if (tnamelen != 7 || strnicmp(tname, "session", 7)) {
i = cryptSetAttribute(sbbs->ssh_session, CRYPT_SESSINFO_SSH_CHANNEL, cid);
GCESS(i, client_socket, sbbs->ssh_session, "getting channel id");
i = cryptSetAttribute(sbbs->ssh_session, CRYPT_SESSINFO_SSH_CHANNEL_ACTIVE, 0);
GCESS(i, client_socket, sbbs->ssh_session, "closing channel");
if (i == CRYPT_ERROR_PERMISSION) {
// Fail because there's no session.
ssh_failed = 3;
}
lprintf(LOG_INFO, "%04d SSH active channel '%s' is not 'session', disconnecting.", client_socket, tname);
// Fail because there's no session.
ssh_failed = 3;
}
else {
else
sbbs->session_channel = cid;
lprintf(LOG_DEBUG, "Session channel id=%d", sbbs->session_channel);
}
}
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment