Re: SSH error messages not shown
От | Dave Page |
---|---|
Тема | Re: SSH error messages not shown |
Дата | |
Msg-id | ECFC356A-781C-4969-A011-0511E5137D09@pgadmin.org обсуждение исходный текст |
Ответ на | SSH error messages not shown (Jacek Wielemborek <d33tah@gmail.com>) |
Ответы |
Re: SSH error messages not shown
|
Список | pgadmin-hackers |
Akshay, can you look into this please?
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK:http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK:http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Hi,
When an libssh2 call fails, pgAdmin III just shows the error code and
nothing else. Consider the following patch - this is what I created
while wondering why my hostkeys don't work:
diff --git a/pgadmin/utils/sshTunnel.cpp b/pgadmin/utils/sshTunnel.cpp
index fd80214..e15f764 100644
--- a/pgadmin/utils/sshTunnel.cpp
+++ b/pgadmin/utils/sshTunnel.cpp
@@ -201,8 +201,13 @@ bool CSSHTunnelThread::Initialize()
#endif
if (rc)
{
-
LogSSHTunnelErrors(wxString::Format(_("SSH error: Authentication by
identity file failed with error code %d"), rc), GetId());
+ char* errmsg;
+ int errmsg_len;
+ libssh2_session_last_error(m_session,
&errmsg, &errmsg_len, 0);
+ wxString errmsg_s(errmsg, wxConvLibc);
+
LogSSHTunnelErrors(wxString::Format(_("SSH error: Authentication by
identity file failed with error code %d [%s]"), rc, errmsg_s.c_str()),
GetId());
Cleanup();
+ free(errmsg);
return false;
}
}
Perhaps we could use this kind of routines wherever rc is being checked?
Cheers,
d33tah
В списке pgadmin-hackers по дате отправления: