This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goclient. from ad62687 src/sshmasterconnection: ignore "garbage", but require at least one line to start with a known challenge auth prompt. Fixes: #966. new 4a3f7fe x2goclient.pro: add libssh_threads library. new 1f07f3c copy-deps-win32.bat: also copy libssh_threads.dll to go with the previous change. new 07a37d3 src/{onmainwindow,sshmasterconnection}.{cpp,h}: correctly initialize and finalize libssh. The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: copy-deps-win32.bat | 1 + debian/changelog | 8 ++++++++ src/onmainwindow.cpp | 22 +++++++++++++++++++++- src/onmainwindow.h | 2 ++ src/sshmasterconnection.cpp | 41 ----------------------------------------- src/sshmasterconnection.h | 1 - x2goclient.pro | 2 +- 7 files changed, 33 insertions(+), 44 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 1f07f3cc08ecf2cf2a774289c4d2612b165ab699 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 9 05:35:03 2017 +0200 copy-deps-win32.bat: also copy libssh_threads.dll to go with the previous change. --- copy-deps-win32.bat | 1 + debian/changelog | 2 ++ 2 files changed, 3 insertions(+) diff --git a/copy-deps-win32.bat b/copy-deps-win32.bat index 6e468fb..1fe50b5 100755 --- a/copy-deps-win32.bat +++ b/copy-deps-win32.bat @@ -5,6 +5,7 @@ if "%~3"=="" ( xcopy /E /Y %1\cygwin\20160121-3_bin %3\ || exit /b %errorlevel% del %3\nxproxy.exe.unstripped %3\libXcomp.a %3\libXcomp.dll.a || exit /b %errorlevel% xcopy /E /Y %1\libssh\0.7.4-x2go1-mingw482_bin\bin\libssh.dll %3\ || exit /b %errorlevel% +xcopy /E /Y %1\libssh\0.7.4-x2go1-mingw482_bin\bin\libssh_threads.dll %3\ || exit /b %errorlevel% xcopy /E /Y %1\MinGW-DLLs\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\libgcc_s_dw2-1.dll %3\ || exit /b %errorlevel% xcopy /E /Y %1\MinGW-DLLs\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\libstdc++-6.dll %3\ || exit /b %errorlevel% xcopy /E /Y %1\MinGW-DLLs\i686-4.8.2-release-posix-dwarf-rt_v3-rev3\libwinpthread-1.dll %3\ || exit /b %errorlevel% diff --git a/debian/changelog b/debian/changelog index 434c3be..c81d01c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -186,6 +186,8 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium to start with a known challenge auth prompt. Fixes: #966. - x2goclient.pro: add libssh_threads library. We need this since X2Go Client is multi-threaded. + - copy-deps-win32.bat: also copy libssh_threads.dll to go with the + previous change. * x2goclient.spec: - Respect %{optflags} and pass QMAKE_STRIP=: to fix missing debug info issues. -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 4a3f7fe7ef56448303ca0174c41146cf826e46b2 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 9 05:34:23 2017 +0200 x2goclient.pro: add libssh_threads library. We need this since X2Go Client is multi-threaded. --- debian/changelog | 2 ++ x2goclient.pro | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9ed36f0..434c3be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -184,6 +184,8 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium place and why it's so complicated. - src/sshmasterconnection: ignore "garbage", but require at least one line to start with a known challenge auth prompt. Fixes: #966. + - x2goclient.pro: add libssh_threads library. We need this since X2Go + Client is multi-threaded. * x2goclient.spec: - Respect %{optflags} and pass QMAKE_STRIP=: to fix missing debug info issues. diff --git a/x2goclient.pro b/x2goclient.pro index a1174f2..71935e2 100644 --- a/x2goclient.pro +++ b/x2goclient.pro @@ -132,7 +132,7 @@ SOURCES += src/sharewidget.cpp \ src/compat.cpp \ src/pulsemanager.cpp -LIBS += -lssh +LIBS += -lssh -lssh_threads win32:LIBS += -lAdvAPI32 -lshell32 -lUser32 plugin { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2goclient. commit 07a37d3aa378f18de6a8aa9a268fc90ef10e38bc Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Sep 9 05:37:56 2017 +0200 src/{onmainwindow,sshmasterconnection}.{cpp,h}: correctly initialize and finalize libssh. We ought to do both only once - in our main thread. Previously, we initialized libssh in a new thread, which might be problematic. --- debian/changelog | 4 ++++ src/onmainwindow.cpp | 22 +++++++++++++++++++++- src/onmainwindow.h | 2 ++ src/sshmasterconnection.cpp | 41 ----------------------------------------- src/sshmasterconnection.h | 1 - 5 files changed, 27 insertions(+), 43 deletions(-) diff --git a/debian/changelog b/debian/changelog index c81d01c..43bfe2a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -188,6 +188,10 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium Client is multi-threaded. - copy-deps-win32.bat: also copy libssh_threads.dll to go with the previous change. + - src/{onmainwindow,sshmasterconnection}.{cpp,h}: correctly initialize and + finalize libssh. We ought to do both only once - in our main thread. + Previously, we initialized libssh in a new thread, which might be + problematic. * x2goclient.spec: - Respect %{optflags} and pass QMAKE_STRIP=: to fix missing debug info issues. diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index b7f65d7..0cb4f2c 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -550,6 +550,8 @@ ONMainWindow::ONMainWindow ( QWidget *parent ) :QMainWindow ( parent ) activateWindow(); raise(); } + + QTimer::singleShot (200, this, SLOT (slotInitLibssh ())); } @@ -1607,7 +1609,13 @@ void ONMainWindow::closeClient() #endif cleanPortable(); } - SshMasterConnection::finalizeLibSsh(); + + if (ssh_finalize ()) { + x2goDebug << "Unable to finalize libssh. Something may be wrong!"; + } + else { + x2goDebug << "libssh finalized."; + } x2goInfof(7)<<tr("Finished X2Go Client closing hooks."); } @@ -12935,6 +12943,18 @@ long ONMainWindow::findWindow ( QString text ) return 0; } +void ONMainWindow::slotInitLibssh () { + /* Initialize libssh. This must be done outside of any threading context. */ + x2goDebug << "libssh not initialized yet. Initializing."; + ssh_threads_set_callbacks(ssh_threads_get_pthread ()); + if (ssh_init ()) { + x2goDebug << "Cannot initialize libssh."; + QMessageBox::critical (this, tr ("libssh initialization failure"), + tr ("Unable to initialize libssh.")); + trayQuit (); + } +} + //////////////////////////plugin stuff////////////// #ifdef CFGPLUGIN diff --git a/src/onmainwindow.h b/src/onmainwindow.h index a7aa00d..a5d518f 100644 --- a/src/onmainwindow.h +++ b/src/onmainwindow.h @@ -45,6 +45,7 @@ #include <QLocale> #include <QProcessEnvironment> #include <QDirIterator> +#include <libssh/callbacks.h> #include "sshmasterconnection.h" #include "non_modal_messagebox.h" @@ -1166,6 +1167,7 @@ private slots: void slotReconnectSession(); void slotStartBroker(); void slotStartNewBrokerSession (); + void slotInitLibssh (); #ifdef Q_OS_DARWIN void slotSetModMap(); void handle_xmodmap_error (QProcess &proc); diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index e0ea7d2..c0360b8 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -54,8 +54,6 @@ #undef SSH_DEBUG // #define SSH_DEBUG -static bool isLibSshInited=false; - const QString SshMasterConnection::challenge_auth_code_prompts_[] = { "Verification code:", // GA (http://github.com/google/google-authenticator) "One-time password (OATH) for", // OATH (http://www.nongnu.org/oath-toolkit/pam_oath.html) @@ -566,29 +564,6 @@ void SshMasterConnection::run() } } disconnectSessionFlag=false; - if ( !isLibSshInited ) - { -#ifdef DEBUG - x2goDebug<<"libssh not initialized yet. Initializing."; -#endif - if ( ssh_init() !=0 ) - { - QString err=tr ( "Cannot initialize libssh." ); -#ifdef DEBUG - x2goDebug<<err<<endl; -#endif - emit connectionError ( err,"" ); - quit(); - return; - } - isLibSshInited=true; - } -#ifdef DEBUG - else - { - x2goDebug<<"libssh already initialized."; - } -#endif #ifdef SSH_DEBUG int verbosity=SSH_LOG_PACKET; @@ -836,22 +811,6 @@ SshMasterConnection::~SshMasterConnection() } -void SshMasterConnection::finalizeLibSsh() -{ - if ( !isLibSshInited ) - { -#ifdef DEBUG - x2goDebug<<"libssh not initialized yet."; -#endif - return; - } - - ssh_finalize(); -#ifdef DEBUG - x2goDebug<<"libssh finalized."; -#endif -} - bool SshMasterConnection::sshConnect() { int rc; diff --git a/src/sshmasterconnection.h b/src/sshmasterconnection.h index 18ef0a4..e6924e0 100644 --- a/src/sshmasterconnection.h +++ b/src/sshmasterconnection.h @@ -81,7 +81,6 @@ public: QString proxylogin=QString::null, QString proxypassword=QString::null, QString proxyKey=QString::null, bool proxyAutologin=false, bool proxyKrbLogin=false); ~SshMasterConnection(); - static void finalizeLibSsh(); void addChannelConnection(SshProcess* creator, int sock, QString forwardHost, int forwardPort, QString localHost, int localPort, void* channel=0l); void addChannelConnection(SshProcess* creator, QString uuid, QString cmd); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git