Revision: 8063 https://osdn.net/projects/ttssh2/scm/svn/commits/8063 Author: yutakapon Date: 2019-09-03 23:25:31 +0900 (Tue, 03 Sep 2019) Log Message: ----------- known_hostsダイアログが表示されている状態で、サーバから切断を行うと、 TTXCloseTCPが呼び出され、TTSSHのリソースが解放されてしまう。 SSHハンドラの延長でknown_hostsダイアログを出して止まっているため、 ダイアログを閉じて、処理再開すると、SSHの内部情報が壊れる。 その状態で再度SSH接続しようとすると100%アプリが落ちる。 上記問題に対して、まずは SSH1 に処置した。 Modified Paths: -------------- branches/ttssh_improved/ttssh2/ttxssh/hosts.c branches/ttssh_improved/ttssh2/ttxssh/hosts.h branches/ttssh_improved/ttssh2/ttxssh/ttxssh.c branches/ttssh_improved/ttssh2/ttxssh/ttxssh.h -------------- next part -------------- Modified: branches/ttssh_improved/ttssh2/ttxssh/hosts.c =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/hosts.c 2019-09-03 01:45:42 UTC (rev 8062) +++ branches/ttssh_improved/ttssh2/ttxssh/hosts.c 2019-09-03 14:25:31 UTC (rev 8063) @@ -2309,14 +2309,29 @@ // \x82\xB3\x82\xB9\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82邽\x82߁A\x92\xBC\x90ڃR\x81[\x83\x8B\x82ɕύX\x82\xB7\x82\xE9\x81B // \x82\xB1\x82\xEA\x82ɂ\xE6\x82\xE8known_hosts\x82̊m\x94F\x82\xF0\x91҂\xBD\x82\xB8\x82ɁA\x83T\x81[\x83o\x82փ\x86\x81[\x83U\x8F\xEE\x95\xF1\x82𑗂\xC1\x82Ă\xB5\x82܂\xA4\x96\xE2\x91\xE8\x82\xF0\x89\xF1\x94\xF0\x82\xB7\x82\xE9\x81B // (2007.10.1 yutaka) + /* + * known_hosts\x83_\x83C\x83A\x83\x8D\x83O\x82͔\xFA\x82ŕ\\x8E\xA6\x82\xB3\x82\xB9\x82\xE9\x82̂\xAA\x90\xB3\x82\xB5\x82\xA9\x82\xC1\x82\xBD\x81B + * known_hosts\x83_\x83C\x83A\x83\x8D\x83O\x82\xAA\x95\\x8E\xA6\x82\xB3\x82\xEA\x82Ă\xA2\x82\xE9\x8F\xF3\x91ԂŁA\x83T\x81[\x83o\x82\xA9\x82\xE7\x90ؒf\x82\xF0\x8Ds\x82\xA4\x82ƁA + * TTXCloseTCP\x82\xAA\x8CĂяo\x82\xB3\x82\xEA\x81ATTSSH\x82̃\x8A\x83\\x81[\x83X\x82\xAA\x89\xF0\x95\xFA\x82\xB3\x82\xEA\x82Ă\xB5\x82܂\xA4\x81B + * SSH\x83n\x83\x93\x83h\x83\x89\x82̉\x84\x92\xB7\x82\xC5known_hosts\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x8Fo\x82\xB5\x82Ď~\x82܂\xC1\x82Ă\xA2\x82邽\x82߁A + * \x8F\x88\x97\x9D\x8DĊJ\x8C\xE3\x82ɕs\x90\xB3\x83A\x83N\x83Z\x83X\x82ŗ\x8E\x82\xBF\x82\xE9\x81B + * (2019.9.3 yutaka) + */ if (found_different_key) { HOSTS_do_different_key_dialog(pvar->NotificationWindow, pvar); + //PostMessage(pvar->NotificationWindow, WM_COMMAND, ID_SSHDIFFERENTKEY, 0); } else if (found_different_type_key) { HOSTS_do_different_type_key_dialog(pvar->NotificationWindow, pvar); + //PostMessage(pvar->NotificationWindow, WM_COMMAND, ID_SSHDIFFERENT_TYPE_KEY, 0); } else { - HOSTS_do_unknown_host_dialog(pvar->NotificationWindow, pvar); + // \x82܂\xB8\x82\xCDSSH1\x82̂ݏ\x88\x92u\x81B + if (SSHv1(pvar)) { + PostMessage(pvar->NotificationWindow, WM_COMMAND, ID_SSHUNKNOWNHOST, 0); + } else { + HOSTS_do_unknown_host_dialog(pvar->NotificationWindow, pvar); + } } return TRUE; Modified: branches/ttssh_improved/ttssh2/ttxssh/hosts.h =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/hosts.h 2019-09-03 01:45:42 UTC (rev 8062) +++ branches/ttssh_improved/ttssh2/ttxssh/hosts.h 2019-09-03 14:25:31 UTC (rev 8063) @@ -69,6 +69,7 @@ #endif void HOSTS_do_unknown_host_dialog(HWND wnd, PTInstVar pvar); void HOSTS_do_different_key_dialog(HWND wnd, PTInstVar pvar); +void HOSTS_do_different_type_key_dialog(HWND wnd, PTInstVar pvar); void HOSTS_notify_disconnecting(PTInstVar pvar); void HOSTS_notify_closing_on_exit(PTInstVar pvar); void HOSTS_end(PTInstVar pvar); Modified: branches/ttssh_improved/ttssh2/ttxssh/ttxssh.c =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/ttxssh.c 2019-09-03 01:45:42 UTC (rev 8062) +++ branches/ttssh_improved/ttssh2/ttxssh/ttxssh.c 2019-09-03 14:25:31 UTC (rev 8063) @@ -5115,6 +5115,10 @@ UTIL_SetDialogFont(); HOSTS_do_different_key_dialog(hWin, pvar); return 1; + case ID_SSHDIFFERENT_TYPE_KEY: + UTIL_SetDialogFont(); + HOSTS_do_different_type_key_dialog(hWin, pvar); + return 1; case ID_SSHASYNCMESSAGEBOX: if (pvar->err_msg != NULL) { char *msg = pvar->err_msg; Modified: branches/ttssh_improved/ttssh2/ttxssh/ttxssh.h =================================================================== --- branches/ttssh_improved/ttssh2/ttxssh/ttxssh.h 2019-09-03 01:45:42 UTC (rev 8062) +++ branches/ttssh_improved/ttssh2/ttxssh/ttxssh.h 2019-09-03 14:25:31 UTC (rev 8063) @@ -108,6 +108,7 @@ #define ID_SSHUNKNOWNHOST 62502 #define ID_SSHDIFFERENTKEY 62503 #define ID_SSHASYNCMESSAGEBOX 62504 +#define ID_SSHDIFFERENT_TYPE_KEY 62505 #define OPTION_NONE 0 #define OPTION_CLEAR 1