From 4ca0d58f1d35265351ae2e7a0cb8316b4f02013c Mon Sep 17 00:00:00 2001 From: Apex Liu Date: Mon, 27 Nov 2017 23:22:59 +0800 Subject: [PATCH] temp. --- external/libssh-win-static/include/config.h | 393 ++++++++-------- .../libssh-win-static/libssh.vs2015.vcxproj | 439 +++++++++--------- .../libssh.vs2015.vcxproj.filters | 419 ++++++++--------- server/tp_core/protocol/ssh/ssh_proxy.cpp | 2 + server/tp_core/protocol/ssh/ssh_session.cpp | 8 +- .../webroot/app/controller/account.py | 2 +- 6 files changed, 638 insertions(+), 625 deletions(-) diff --git a/external/libssh-win-static/include/config.h b/external/libssh-win-static/include/config.h index 0a57676..d4643f5 100644 --- a/external/libssh-win-static/include/config.h +++ b/external/libssh-win-static/include/config.h @@ -1,196 +1,197 @@ -#ifdef _DEBUG -#include -#endif - -/* Name of package */ -#define PACKAGE "libssh" - -/* Version number of package */ -#define VERSION "0.7.4" - -/* #undef LOCALEDIR */ -/* #undef DATADIR */ -//#define LIBDIR "lib" -//#define PLUGINDIR "plugins-4" -/* #undef SYSCONFDIR */ -//#define BINARYDIR "E:/work/eomsoft/tmp/libssh/build" -//#define SOURCEDIR "E:/work/eomsoft/tmp/libssh" - -/************************** HEADER FILES *************************/ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ARGP_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ARPA_INET_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_PTY_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_UTMP_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_UTIL_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_LIBUTIL_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_TIME_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_TERMIOS_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_AES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_WSPIAPI_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_BLOWFISH_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_DES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_ECDH_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_EC_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_ECDSA_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_PTHREAD_H */ - -/* Define to 1 if you have eliptic curve cryptography in openssl */ -#define HAVE_OPENSSL_ECC 1 - -/* Define to 1 if you have eliptic curve cryptography in gcrypt */ -/* #undef HAVE_GCRYPT_ECC */ - -/* Define to 1 if you have eliptic curve cryptography */ -#define HAVE_ECC 1 - -/*************************** FUNCTIONS ***************************/ - -/* Define to 1 if you have the `EVP_aes128_ctr' function. */ -#define HAVE_OPENSSL_EVP_AES_CTR 1 - -/* Define to 1 if you have the `EVP_aes128_cbc' function. */ -#define HAVE_OPENSSL_EVP_AES_CBC 1 - -/* Define to 1 if you have the `snprintf' function. */ -#define HAVE_SNPRINTF 1 - -/* Define to 1 if you have the `_snprintf' function. */ -/* #undef HAVE__SNPRINTF */ - -/* Define to 1 if you have the `_snprintf_s' function. */ -/* #undef HAVE__SNPRINTF_S */ - -/* Define to 1 if you have the `vsnprintf' function. */ -#define HAVE_VSNPRINTF 1 - -/* Define to 1 if you have the `_vsnprintf' function. */ -/* #undef HAVE__VSNPRINTF */ - -/* Define to 1 if you have the `_vsnprintf_s' function. */ -/* #undef HAVE__VSNPRINTF_S */ - -/* Define to 1 if you have the `isblank' function. */ -#define HAVE_ISBLANK 1 - -/* Define to 1 if you have the `strncpy' function. */ -#define HAVE_STRNCPY 1 - -/* Define to 1 if you have the `cfmakeraw' function. */ -/* #undef HAVE_CFMAKERAW */ - -/* Define to 1 if you have the `getaddrinfo' function. */ -#define HAVE_GETADDRINFO 1 - -/* Define to 1 if you have the `poll' function. */ -/* #undef HAVE_POLL */ - -/* Define to 1 if you have the `select' function. */ -#define HAVE_SELECT 1 - -/* Define to 1 if you have the `clock_gettime' function. */ -/* #undef HAVE_CLOCK_GETTIME */ - -/* Define to 1 if you have the `ntohll' function. */ -//#define HAVE_NTOHLL 1 - -/* Define to 1 if you have the `htonll' function. */ -//#define HAVE_HTONLL 1 - -/* Define to 1 if you have the `strtoull' function. */ -/* #undef HAVE_STRTOULL */ - -/* Define to 1 if you have the `__strtoull' function. */ -/* #undef HAVE___STRTOULL */ - -/* Define to 1 if you have the `_strtoui64' function. */ -#define HAVE__STRTOUI64 1 - -/*************************** LIBRARIES ***************************/ - -/* Define to 1 if you have the `crypto' library (-lcrypto). */ -#define HAVE_LIBCRYPTO 1 - -/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */ -/* #undef HAVE_LIBGCRYPT */ - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -/* #undef HAVE_PTHREAD */ - -/**************************** OPTIONS ****************************/ - -/* #undef HAVE_GCC_THREAD_LOCAL_STORAGE */ -#define HAVE_MSC_THREAD_LOCAL_STORAGE 1 - -/* #undef HAVE_GCC_VOLATILE_MEMORY_PROTECTION */ -/*#define HAVE_GCC_NARG_MACRO 1*/ - -/* #undef HAVE_COMPILER__FUNC__ */ -#define HAVE_COMPILER__FUNCTION__ 1 - -/* Define to 1 if you want to enable GSSAPI */ -/* #undef WITH_GSSAPI */ - -/* Define to 1 if you want to enable ZLIB */ -/*#define WITH_ZLIB 1*/ - -/* Define to 1 if you want to enable SFTP */ -#define WITH_SFTP 1 - -/* Define to 1 if you want to enable SSH1 */ -/* #undef WITH_SSH1 */ - -/* Define to 1 if you want to enable server support */ -#define WITH_SERVER 1 - -/* Define to 1 if you want to enable debug output for crypto functions */ -/* #undef DEBUG_CRYPTO */ - -/* Define to 1 if you want to enable pcap output support (experimental) */ -/* #undef WITH_PCAP */ - -/* Define to 1 if you want to enable calltrace debug output */ -/* #undef DEBUG_CALLTRACE */ - -/* Define to 1 if you want to enable NaCl support */ -/* #undef WITH_NACL */ - -/*************************** ENDIAN *****************************/ - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -/* #undef WORDS_BIGENDIAN */ +#ifdef _DEBUG +#include +#endif + +/* Name of package */ +#define PACKAGE "libssh" + +/* Version number of package */ +#define VERSION "0.7.4" + +/* #undef LOCALEDIR */ +/* #undef DATADIR */ +//#define LIBDIR "lib" +//#define PLUGINDIR "plugins-4" +/* #undef SYSCONFDIR */ +//#define BINARYDIR "E:/work/eomsoft/tmp/libssh/build" +//#define SOURCEDIR "E:/work/eomsoft/tmp/libssh" + +/************************** HEADER FILES *************************/ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARGP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_INET_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PTY_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UTMP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UTIL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_LIBUTIL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_TIME_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_TERMIOS_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_UNISTD_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_AES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_WSPIAPI_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_BLOWFISH_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_DES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_ECDH_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_EC_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_OPENSSL_ECDSA_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_PTHREAD_H */ + +/* Define to 1 if you have eliptic curve cryptography in openssl */ +#define HAVE_OPENSSL_ECC 1 + +/* Define to 1 if you have eliptic curve cryptography in gcrypt */ +/* #undef HAVE_GCRYPT_ECC */ + +/* Define to 1 if you have eliptic curve cryptography */ +#define HAVE_ECC 1 + +/*************************** FUNCTIONS ***************************/ + +/* Define to 1 if you have the `EVP_aes128_ctr' function. */ +#define HAVE_OPENSSL_EVP_AES_CTR 1 + +/* Define to 1 if you have the `EVP_aes128_cbc' function. */ +#define HAVE_OPENSSL_EVP_AES_CBC 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define to 1 if you have the `_snprintf' function. */ +/* #undef HAVE__SNPRINTF */ + +/* Define to 1 if you have the `_snprintf_s' function. */ +/* #undef HAVE__SNPRINTF_S */ + +/* Define to 1 if you have the `vsnprintf' function. */ +#define HAVE_VSNPRINTF 1 + +/* Define to 1 if you have the `_vsnprintf' function. */ +/* #undef HAVE__VSNPRINTF */ + +/* Define to 1 if you have the `_vsnprintf_s' function. */ +/* #undef HAVE__VSNPRINTF_S */ + +/* Define to 1 if you have the `isblank' function. */ +#define HAVE_ISBLANK 1 + +/* Define to 1 if you have the `strncpy' function. */ +#define HAVE_STRNCPY 1 + +/* Define to 1 if you have the `cfmakeraw' function. */ +/* #undef HAVE_CFMAKERAW */ + +/* Define to 1 if you have the `getaddrinfo' function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if you have the `poll' function. */ +/* #undef HAVE_POLL */ + +/* Define to 1 if you have the `select' function. */ +#define HAVE_SELECT 1 + +/* Define to 1 if you have the `clock_gettime' function. */ +/* #undef HAVE_CLOCK_GETTIME */ + +/* Define to 1 if you have the `ntohll' function. */ +//#define HAVE_NTOHLL 1 + +/* Define to 1 if you have the `htonll' function. */ +//#define HAVE_HTONLL 1 + +/* Define to 1 if you have the `strtoull' function. */ +/* #undef HAVE_STRTOULL */ + +/* Define to 1 if you have the `__strtoull' function. */ +/* #undef HAVE___STRTOULL */ + +/* Define to 1 if you have the `_strtoui64' function. */ +#define HAVE__STRTOUI64 1 + +/*************************** LIBRARIES ***************************/ + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#define HAVE_LIBCRYPTO 1 + +/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */ +/* #undef HAVE_LIBGCRYPT */ + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +/* #undef HAVE_PTHREAD */ + +/**************************** OPTIONS ****************************/ + +/* #undef HAVE_GCC_THREAD_LOCAL_STORAGE */ +#define HAVE_MSC_THREAD_LOCAL_STORAGE 1 + +/* #undef HAVE_GCC_VOLATILE_MEMORY_PROTECTION */ +/*#define HAVE_GCC_NARG_MACRO 1*/ + +/* #undef HAVE_COMPILER__FUNC__ */ +#define HAVE_COMPILER__FUNCTION__ 1 + +/* Define to 1 if you want to enable GSSAPI */ +/* #undef WITH_GSSAPI */ + +/* Define to 1 if you want to enable ZLIB */ +/*#define WITH_ZLIB 1*/ + +/* Define to 1 if you want to enable SFTP */ +#define WITH_SFTP 1 + +/* Define to 1 if you want to enable SSH1 */ +/* #undef WITH_SSH1 */ +#define WITH_SSH1 + +/* Define to 1 if you want to enable server support */ +#define WITH_SERVER 1 + +/* Define to 1 if you want to enable debug output for crypto functions */ +/* #undef DEBUG_CRYPTO */ + +/* Define to 1 if you want to enable pcap output support (experimental) */ +/* #undef WITH_PCAP */ + +/* Define to 1 if you want to enable calltrace debug output */ +/* #undef DEBUG_CALLTRACE */ + +/* Define to 1 if you want to enable NaCl support */ +/* #undef WITH_NACL */ + +/*************************** ENDIAN *****************************/ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +/* #undef WORDS_BIGENDIAN */ diff --git a/external/libssh-win-static/libssh.vs2015.vcxproj b/external/libssh-win-static/libssh.vs2015.vcxproj index 4b140d5..e1bb799 100644 --- a/external/libssh-win-static/libssh.vs2015.vcxproj +++ b/external/libssh-win-static/libssh.vs2015.vcxproj @@ -1,219 +1,222 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - {228F651A-4726-41CE-89B3-5D07CF55909B} - Win32Proj - libssh - 8.1 - libssh - - - - StaticLibrary - true - v140_xp - MultiByte - - - StaticLibrary - false - v140_xp - true - MultiByte - - - StaticLibrary - true - v140 - Unicode - - - StaticLibrary - false - v140 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(ProjectDir)lib\ - ..\..\out\_tmp_\$(ProjectName)\$(PlatformTarget)\$(Configuration)\ - - - ..\..\out\_tmp_\$(ProjectName)\$(PlatformTarget)\$(Configuration)\ - $(ProjectDir)lib\ - - - - - - Level3 - Disabled - WIN32;_DEBUG;LIBSSH_STATIC;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - .\include;..\openssl\inc32;%(AdditionalIncludeDirectories) - MultiThreadedDebug - - - Windows - true - - - $(OutDir)$(TargetName)MTd$(TargetExt) - - - - - - - Level3 - Disabled - _DEBUG;_LIB;%(PreprocessorDefinitions) - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;LIBSSH_STATIC;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - .\include;..\openssl\inc32 - MultiThreaded - - - Windows - true - true - true - - - $(OutDir)$(TargetName)MT$(TargetExt) - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - - - Windows - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {228F651A-4726-41CE-89B3-5D07CF55909B} + Win32Proj + libssh + 8.1 + libssh + + + + StaticLibrary + true + v140_xp + MultiByte + + + StaticLibrary + false + v140_xp + true + MultiByte + + + StaticLibrary + true + v140 + Unicode + + + StaticLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + $(ProjectDir)lib\ + ..\..\out\_tmp_\$(ProjectName)\$(PlatformTarget)\$(Configuration)\ + + + ..\..\out\_tmp_\$(ProjectName)\$(PlatformTarget)\$(Configuration)\ + $(ProjectDir)lib\ + + + + + + Level3 + Disabled + WIN32;_DEBUG;LIBSSH_STATIC;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + .\include;..\openssl\inc32;%(AdditionalIncludeDirectories) + MultiThreadedDebug + + + Windows + true + + + $(OutDir)$(TargetName)MTd$(TargetExt) + + + + + + + Level3 + Disabled + _DEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;LIBSSH_STATIC;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) + .\include;..\openssl\inc32 + MultiThreaded + + + Windows + true + true + true + + + $(OutDir)$(TargetName)MT$(TargetExt) + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/external/libssh-win-static/libssh.vs2015.vcxproj.filters b/external/libssh-win-static/libssh.vs2015.vcxproj.filters index 4c87dcd..481aeab 100644 --- a/external/libssh-win-static/libssh.vs2015.vcxproj.filters +++ b/external/libssh-win-static/libssh.vs2015.vcxproj.filters @@ -1,208 +1,213 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {8ec876c8-97fa-4f69-a5aa-7c59b5107ca1} - - - {0f864866-f75b-4063-baf2-63c1c0134342} - - - - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files\external - - - Source Files\external - - - Source Files\external - - - Source Files\external - - - Source Files\external - - - Source Files\external - - - Source Files\external - - - Source Files\threads - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {8ec876c8-97fa-4f69-a5aa-7c59b5107ca1} + + + {0f864866-f75b-4063-baf2-63c1c0134342} + + + + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files\external + + + Source Files\external + + + Source Files\external + + + Source Files\external + + + Source Files\external + + + Source Files\external + + + Source Files\external + + + Source Files\threads + + + + + Header Files + + \ No newline at end of file diff --git a/server/tp_core/protocol/ssh/ssh_proxy.cpp b/server/tp_core/protocol/ssh/ssh_proxy.cpp index f9124d9..6c6b540 100644 --- a/server/tp_core/protocol/ssh/ssh_proxy.cpp +++ b/server/tp_core/protocol/ssh/ssh_proxy.cpp @@ -86,6 +86,8 @@ void SshProxy::_thread_loop() { // ע⣬ssh_new()ָ룬ֹͣ־ڲͷˣָ뽻SshSessionʵʱͷš ssh_session sess_to_client = ssh_new(); + int verbosity = 4; + ssh_options_set(sess_to_client, SSH_OPTIONS_LOG_VERBOSITY, &verbosity); ssh_set_blocking(sess_to_client, 1); struct sockaddr_storage sock_client; diff --git a/server/tp_core/protocol/ssh/ssh_session.cpp b/server/tp_core/protocol/ssh/ssh_session.cpp index 4275c74..e60ae93 100644 --- a/server/tp_core/protocol/ssh/ssh_session.cpp +++ b/server/tp_core/protocol/ssh/ssh_session.cpp @@ -348,6 +348,8 @@ int SshSession::_on_auth_password_request(ssh_session session, const char *user, // ڳԸsession-idȡõϢӲ¼SSH EXLOGV("[ssh] try to connect to real SSH server %s:%d\n", _this->m_conn_ip.c_str(), _this->m_conn_port); _this->m_srv_session = ssh_new(); + int verbosity = 4; + ssh_options_set(_this->m_srv_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity); ssh_set_blocking(_this->m_srv_session, 1); ssh_options_set(_this->m_srv_session, SSH_OPTIONS_HOST, _this->m_conn_ip.c_str()); int port = (int)_this->m_conn_port; @@ -596,7 +598,7 @@ int SshSession::_on_client_shell_request(ssh_session session, ssh_channel channe cp->type = TS_SSH_CHANNEL_TYPE_SHELL; g_ssh_env.session_update(cp->db_id, TP_PROTOCOL_TYPE_SSH_SHELL, TP_SESS_STAT_STARTED); - // FIXME: if client is putty, it will block here. the following function will never return. + // FIXME: sometimes it will block here. the following function will never return. // at this time, can not write data to this channel. read from this channel with timeout, got 0 byte. // I have no idea how to fix it... :( int err = ssh_channel_request_shell(cp->srv_channel); @@ -630,7 +632,7 @@ void SshSession::_on_client_channel_close(ssh_session session, ssh_channel chann int SshSession::_on_client_channel_data(ssh_session session, ssh_channel channel, void *data, unsigned int len, int is_stderr, void *userdata) { - //EXLOG_BIN((ex_u8*)data, len, "on_client_channel_data [is_stderr=%d]:", is_stderr); + EXLOG_BIN((ex_u8*)data, len, "on_client_channel_data [is_stderr=%d]:", is_stderr); SshSession *_this = (SshSession *)userdata; @@ -742,7 +744,7 @@ int SshSession::_on_client_channel_exec_request(ssh_session session, ssh_channel } int SshSession::_on_server_channel_data(ssh_session session, ssh_channel channel, void *data, unsigned int len, int is_stderr, void *userdata) { - //EXLOG_BIN((ex_u8*)data, len, "on_server_channel_data [is_stderr=%d]:", is_stderr); + EXLOG_BIN((ex_u8*)data, len, "on_server_channel_data [is_stderr=%d]:", is_stderr); SshSession *_this = (SshSession *)userdata; diff --git a/server/www/teleport/webroot/app/controller/account.py b/server/www/teleport/webroot/app/controller/account.py index b54b4f0..e95c488 100644 --- a/server/www/teleport/webroot/app/controller/account.py +++ b/server/www/teleport/webroot/app/controller/account.py @@ -240,7 +240,7 @@ class DoUpdateAccountHandler(TPBaseJsonHandler): if param['auth_type'] == TP_AUTH_TYPE_PASSWORD and len(param['password']) > 0: code, ret_data = yield core_service_async_enc(param['password']) if code != TPE_OK: - return self.write_json(code, '无法加密存储密码!') + return self.write_json(code) else: param['password'] = ret_data elif param['auth_type'] == TP_AUTH_TYPE_PRIVATE_KEY and len(param['pri_key']) > 0: