This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch feature/libssh-api-upgrade in repository x2goclient. discards d821bc3 src/sshmasterconnection.cpp: enable parsing of ~/.ssh/config. Fixes: #1121. discards 9964ebe src/sshmasterconnection.cpp: port more occurrences of "QString to C string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. discards 84fbe9c src/sshmasterconnection.cpp: fix up some debug strings. discards 6990f50 src/sshmasterconnection.cpp: use QString::arg () to insert function name and thus deduplicate error translation messages. discards cf680f0 src/sshmasterconnection.cpp: replace deprecated channel_free () function with ssh_channel_free (). discards 19f371d src/sshmasterconnection.cpp: replace deprecated channel_close () function with ssh_channel_close (). discards a51c90f src/sshmasterconnection.cpp: replace deprecated channel_send_eof () function with ssh_channel_send_eof (). discards e383a8f src/sshmasterconnection.cpp: replace deprecated channel_write () function with ssh_channel_write (). discards 56c01f2 src/sshmasterconnection.cpp: replace deprecated channel_is_eof () function with ssh_channel_is_eof (). discards 54ce362 src/sshmasterconnection.cpp: replace deprecated channel_read () function with ssh_channel_read (). discards 56369bd src/sshmasterconnection.cpp: replace deprecated channel_poll () function with ssh_channel_poll (). discards 379900b src/sshmasterconnection.cpp: replace deprecated channel_request_exec () function with ssh_channel_request_exec (). discards 974d77e src/sshmasterconnection.cpp: replace deprecated channel_open_session () function with ssh_channel_open_session (). discards deaf15a src/sshmasterconnection.cpp: replace deprecated channel_open_forward () function with ssh_channel_open_forward (). discards 243a925 src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new (). discards de301a6 src/sshmasterconnection.cpp: replace string_free () with its successor ssh_string_free (). discards 9cd8930 src/sshmasterconnection.cpp: with libssh 0.6.0 and newer, get the public key via ssh_get_server_publickey () (0.8.0 and higher) or ssh_get_publickey () (0.7.x and lower) and its hash via ssh_get_publickey_hash () instead of using the deprecated ssh_get_pubkey_hash () function. discards 415cced src/sshmasterconnection.cpp: use ssh_channel_listen_forward () instead of ssh_forward_listen () for newer libssh versions. Fixes: #870. adds a997595 res/i18n/x2goclient_sv.ts: fixup Swedish translation file. adds e9a7aac res/i18n/x2goclient_sv.ts: remove obsolete comments and very minor whitespace fix. adds 812c4b8 macbuild.sh: sanitize find input, as BSD find and GNU find behave differently. adds 368b71d macbuild.sh: get rid of problems and use gfind directly. We need special GNU features. adds 3aa8515 src/appdialog.cpp: logic so that X2Go-Top applications are shown again. adds 84d41d5 res/i18n/x2goclient_fi.ts: update Finnish translation file. adds 5a7a20b res/i18n/x2goclient_fi.ts: fix up Finnish translation file, including typo, whitespace fixes and marking untranslated entries as such again, after removing the English "translation" text. adds add03ee release 4.1.0.0 adds 7f2edea Continue development new 9612e6a src/sshmasterconnection.cpp: use ssh_channel_listen_forward () instead of ssh_forward_listen () for newer libssh versions. Fixes: #870. new 15ce4da src/sshmasterconnection.cpp: with libssh 0.6.0 and newer, get the public key via ssh_get_server_publickey () (0.8.0 and higher) or ssh_get_publickey () (0.7.x and lower) and its hash via ssh_get_publickey_hash () instead of using the deprecated ssh_get_pubkey_hash () function. new c6ce255 src/sshmasterconnection.cpp: replace string_free () with its successor ssh_string_free (). new d616e09 src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new (). new dffc470 src/sshmasterconnection.cpp: replace deprecated channel_open_forward () function with ssh_channel_open_forward (). new 3b037cd src/sshmasterconnection.cpp: replace deprecated channel_open_session () function with ssh_channel_open_session (). new b722370 src/sshmasterconnection.cpp: replace deprecated channel_request_exec () function with ssh_channel_request_exec (). new f1abcbd src/sshmasterconnection.cpp: replace deprecated channel_poll () function with ssh_channel_poll (). new e67bf45 src/sshmasterconnection.cpp: replace deprecated channel_read () function with ssh_channel_read (). new f86895a src/sshmasterconnection.cpp: replace deprecated channel_is_eof () function with ssh_channel_is_eof (). new d14a335 src/sshmasterconnection.cpp: replace deprecated channel_write () function with ssh_channel_write (). new a71ce02 src/sshmasterconnection.cpp: replace deprecated channel_send_eof () function with ssh_channel_send_eof (). new efd41a9 src/sshmasterconnection.cpp: replace deprecated channel_close () function with ssh_channel_close (). new 1d8a37a src/sshmasterconnection.cpp: replace deprecated channel_free () function with ssh_channel_free (). new ed981d1 src/sshmasterconnection.cpp: use QString::arg () to insert function name and thus deduplicate error translation messages. new bb727e5 src/sshmasterconnection.cpp: fix up some debug strings. new a5b4d79 src/sshmasterconnection.cpp: port more occurrences of "QString to C string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. new a5639de src/sshmasterconnection.cpp: enable parsing of ~/.ssh/config. Fixes: #1121. This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (d821bc3) \ N -- N -- N refs/heads/feature/libssh-api-upgrade (a5639de) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 18 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: VERSION | 2 +- debian/changelog | 137 ++++++++++------- macbuild.sh | 11 +- man/man1/x2goclient.1 | 2 +- res/i18n/x2goclient_fi.ts | 204 ++++++++++++++----------- res/i18n/x2goclient_sv.ts | 19 +-- src/appdialog.cpp | 24 ++- src/version.h | 2 +- x2gobrowserplugin-2.4_1/src/res/x2goplugin.rc | 10 +- x2goclient.spec | 2 +- 10 files changed, 233 insertions(+), 180 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 feature/libssh-api-upgrade in repository x2goclient. commit 9612e6a5aaf6f930d3c79d861a7c92b7df83b156 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 16:04:28 2017 +0100 src/sshmasterconnection.cpp: use ssh_channel_listen_forward () instead of ssh_forward_listen () for newer libssh versions. Fixes: #870. --- debian/changelog | 5 ++++- src/sshmasterconnection.cpp | 35 ++++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/debian/changelog b/debian/changelog index 605a504..f911630 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - * Continue development + [ Mihai Moldovan ] + * New upstream version (4.1.0.1): + - src/sshmasterconnection.cpp: use ssh_channel_listen_forward () instead + of ssh_forward_listen () for newer libssh versions. Fixes: #870. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 84e0970..b3f9aa3 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -279,22 +279,35 @@ void SshMasterConnection::addReverseTunnelConnections() if(!reverseTunnelRequest[i].listen) { reverseTunnelRequest[i].listen=true; - int rc=ssh_forward_listen(my_ssh_session, NULL, reverseTunnelRequest[i].forwardPort, NULL); - if(rc==SSH_OK) - { - emit reverseTunnelOk(reverseTunnelRequest[i].creator); + + int rc = SSH_AGAIN; + +#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 7, 0) + /* Non-blocking mode may return SSH_AGAIN, so try again if neceassary. */ + while (SSH_AGAIN == rc) { + rc = ssh_channel_listen_forward(my_ssh_session, NULL, reverseTunnelRequest[i].forwardPort, NULL); +#else + rc = ssh_forward_listen(my_ssh_session, NULL, reverseTunnelRequest[i].forwardPort, NULL); +#endif + + if(rc==SSH_OK) + { + emit reverseTunnelOk(reverseTunnelRequest[i].creator); #ifdef DEBUG - x2goDebug<<"Listening for TCP/IP connections on "<<reverseTunnelRequest[i].forwardPort; + x2goDebug<<"Listening for TCP/IP connections on "<<reverseTunnelRequest[i].forwardPort; #endif - } - if(rc==SSH_ERROR) - { - QString err=ssh_get_error(my_ssh_session); + } + if(rc==SSH_ERROR) + { + QString err=ssh_get_error(my_ssh_session); #ifdef DEBUG - x2goDebug<<"Forward port "<<reverseTunnelRequest[i].forwardPort<<" failed:"<<err; + x2goDebug<<"Forward port "<<reverseTunnelRequest[i].forwardPort<<" failed:"<<err; #endif - emit reverseTunnelFailed(reverseTunnelRequest[i].creator, err); + emit reverseTunnelFailed(reverseTunnelRequest[i].creator, err); + } +#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 7, 0) } +#endif } } reverseTunnelRequestMutex.unlock(); -- 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 feature/libssh-api-upgrade in repository x2goclient. commit dffc470d3735908280d440a69c445e52568f4bad Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 17:45:31 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_open_forward () function with ssh_channel_open_forward (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 98030f9..06a27f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new (). Might break on ancient systems, but we don't care. Also, add error handling in case ssh_channel_new () failed... + - src/sshmasterconnection.cpp: replace deprecated channel_open_forward () + function with ssh_channel_open_forward (). Might break on ancient + systems, but we don't care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 360925d..c7d851b 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1577,15 +1577,15 @@ void SshMasterConnection::channelLoop() #ifdef DEBUG x2goDebug<<"Forwarding new channel, local port: "<<channelConnections.at ( i ).localPort<<endl; #endif - if ( channel_open_forward ( channel, - channelConnections.at ( i ).forwardHost.toLatin1(), - channelConnections.at ( i ).forwardPort, - channelConnections.at ( i ).localHost.toLatin1(), - channelConnections.at ( i ).localPort ) != SSH_OK ) + if ( ssh_channel_open_forward ( channel, + channelConnections.at ( i ).forwardHost.toLatin1(), + channelConnections.at ( i ).forwardPort, + channelConnections.at ( i ).localHost.toLatin1(), + channelConnections.at ( i ).localPort ) != SSH_OK ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "channel_open_forward failed." ); - emit ioErr ( channelConnections[i].creator, errorMsg, err ); + QString errorMsg=tr ( "ssh_channel_open_forward failed" ); + emit ioErr ( channelConnections[i].creator, errorMsg + ".", err ); #ifdef DEBUG x2goDebug<<errorMsg<<": "<<err<<endl; #endif -- 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 feature/libssh-api-upgrade in repository x2goclient. commit c6ce2553e886c919774fa33cbd4362d75e1b7e58 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 17:15:38 2017 +0100 src/sshmasterconnection.cpp: replace string_free () with its successor ssh_string_free (). Will break on ancient systems, but we don't care. --- debian/changelog | 2 ++ src/sshmasterconnection.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8c8a2e6..fab0032 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium ssh_get_hexa (). This will break on very old systems with a hopelessly outdated libssh version, but we do not care about these systems in the first place. + - src/sshmasterconnection.cpp: replace string_free () with its successor + ssh_string_free (). Will break on ancient systems, but we don't care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index c786717..57c33fa 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1192,7 +1192,7 @@ bool SshMasterConnection::userAuthWithKey() int rc=ssh_userauth_pubkey(my_ssh_session, NULL, pubkeyStr, prkey); privatekey_free(prkey); - string_free(pubkeyStr); + ssh_string_free(pubkeyStr); #ifdef DEBUG x2goDebug<<"Authenticating with key: "<<rc<<endl; -- 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 feature/libssh-api-upgrade in repository x2goclient. commit d616e09c95db474b69f77a1bb681d4fcdca372e9 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 17:36:03 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new (). Might break on ancient systems, but we don't care. Also, add error handling in case ssh_channel_new () failed... --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 14 +++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fab0032..98030f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium first place. - src/sshmasterconnection.cpp: replace string_free () with its successor ssh_string_free (). Will break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_new () function + with ssh_channel_new (). Might break on ancient systems, but we don't + care. Also, add error handling in case ssh_channel_new () failed... -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 57c33fa..360925d 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1555,7 +1555,19 @@ void SshMasterConnection::channelLoop() #ifdef DEBUG x2goDebug<<"Creating new channel."<<endl; #endif - ssh_channel channel=channel_new ( my_ssh_session ); + ssh_channel channel = ssh_channel_new ( my_ssh_session ); + + if (!channel) { + QString err = ssh_get_error (my_ssh_session); + QString error_msg = tr ("ssh_channel_new failed"); + emit ioErr (channelConnections[i].creator, error_msg + ".", err); + +#ifdef DEBUG + x2goDebug << errorMsg << ": " << err << endl; +#endif + + continue; + } #ifdef DEBUG x2goDebug<<"New channel:"<<channel<<endl; #endif -- 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 feature/libssh-api-upgrade in repository x2goclient. commit 15ce4dac9b7d32e667eb946d815270d4915429b6 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 17:08:43 2017 +0100 src/sshmasterconnection.cpp: with libssh 0.6.0 and newer, get the public key via ssh_get_server_publickey () (0.8.0 and higher) or ssh_get_publickey () (0.7.x and lower) and its hash via ssh_get_publickey_hash () instead of using the deprecated ssh_get_pubkey_hash () function. Additionally, replace free () with the more appropriate ssh_string_free_char () function after using ssh_get_hexa (). This will break on very old systems with a hopelessly outdated libssh version, but we do not care about these systems in the first place. --- debian/changelog | 9 +++++++++ src/sshmasterconnection.cpp | 40 +++++++++++++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index f911630..8c8a2e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,15 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium * New upstream version (4.1.0.1): - src/sshmasterconnection.cpp: use ssh_channel_listen_forward () instead of ssh_forward_listen () for newer libssh versions. Fixes: #870. + - src/sshmasterconnection.cpp: with libssh 0.6.0 and newer, get the public + key via ssh_get_server_publickey () (0.8.0 and higher) or + ssh_get_publickey () (0.7.x and lower) and its hash via + ssh_get_publickey_hash () instead of using the deprecated + ssh_get_pubkey_hash () function. Additionally, replace free () with the + more appropriate ssh_string_free_char () function after using + ssh_get_hexa (). This will break on very old systems with a hopelessly + outdated libssh version, but we do not care about these systems in the + first place. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index b3f9aa3..c786717 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -20,6 +20,7 @@ #include "sshmasterconnection.h" #include <stdlib.h> #include <stdio.h> +#include <stddef.h> #include "sshprocess.h" @@ -812,22 +813,47 @@ int SshMasterConnection::serverAuth ( QString& errorMsg ) x2goDebug<<"cserverAuth"; #endif - int state, hlen; + int state = SSH_SERVER_ERROR; unsigned char *hash = NULL; - char *hexa; + char *hexa = NULL; +#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 6, 0) + ssh_key srv_pubkey = { 0 }; + int rc = SSH_ERROR; + size_t hlen = 0; +#else + int hlen = 0; +#endif state = ssh_is_server_known ( my_ssh_session ); - hlen = ssh_get_pubkey_hash ( my_ssh_session, &hash ); +#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 6, 0) +#if LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 8, 0) + rc = ssh_get_server_publickey (my_ssh_session, &srv_pubkey); +#else /* LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 8, 0) */ + rc = ssh_get_publickey (my_ssh_session, &srv_pubkey); +#endif /* LIBSSH_VERSION_INT >= SSH_VERSION_INT (0, 8, 0) */ + + if (SSH_OK != rc) { + return (SSH_SERVER_ERROR); + } + + rc = ssh_get_publickey_hash (srv_pubkey, SSH_PUBLICKEY_HASH_SHA1, &hash, &hlen); + ssh_key_free (srv_pubkey); - if ( hlen < 0 ) + if (0 != rc) { + return (SSH_SERVER_ERROR); + } +#else + hlen = ssh_get_pubkey_hash ( my_ssh_session, &hash ); +#endif + + if ( 0 >= hlen ) return SSH_SERVER_ERROR; #ifdef DEBUG x2goDebug<<"state: "<<state<<endl; #endif - switch ( state ) { case SSH_SERVER_KNOWN_OK: @@ -836,7 +862,7 @@ int SshMasterConnection::serverAuth ( QString& errorMsg ) case SSH_SERVER_KNOWN_CHANGED: hexa = ssh_get_hexa ( hash, hlen ); errorMsg=host+":"+QString::number(port)+" - "+hexa; - free ( hexa ); + ssh_string_free_char ( hexa ); break; case SSH_SERVER_FOUND_OTHER: break; @@ -846,7 +872,7 @@ int SshMasterConnection::serverAuth ( QString& errorMsg ) { hexa = ssh_get_hexa ( hash, hlen ); errorMsg=host+":"+QString::number(port)+" - "+hexa; - free ( hexa ); + ssh_string_free_char ( hexa ); break; } ssh_write_knownhost ( my_ssh_session ); -- 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 feature/libssh-api-upgrade in repository x2goclient. commit e67bf45a3c2424252a9bd363fb7141ad83515503 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 18:06:22 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_read () function with ssh_channel_read (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index fc1a4ba..ede793d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -30,6 +30,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_poll () function with ssh_channel_poll (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_read () function + with ssh_channel_read (). Might break on ancient systems, but we don't + care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 990fb93..dd2df0e 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1662,7 +1662,7 @@ void SshMasterConnection::channelLoop() #ifdef DEBUG // x2goDebug<<"read err data from channel\n"; #endif - nbytes = channel_read ( channel, buffer, sizeof ( buffer )-1, 1 ); + nbytes = ssh_channel_read ( channel, buffer, sizeof ( buffer )-1, 1 ); emit stdErr ( channelConnections[i].creator, QByteArray ( buffer,nbytes ) ); #ifdef DEBUG // x2goDebug<<nbytes<<" err from channel"<<endl; @@ -1683,7 +1683,7 @@ void SshMasterConnection::channelLoop() #ifdef DEBUG // x2goDebug<<"read data from channel "<<channel<<endl; #endif - nbytes = channel_read ( channel, buffer, sizeof ( buffer )-1, 0 ); + nbytes = ssh_channel_read ( channel, buffer, sizeof ( buffer )-1, 0 ); #ifdef DEBUG // x2goDebug<<nbytes<<" from channel "<<channel<<endl; #endif -- 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 feature/libssh-api-upgrade in repository x2goclient. commit b7223706ae9ee2dd674f7c094c27f72687dc5ddb Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 17:52:29 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_request_exec () function with ssh_channel_request_exec (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 284e150..3f7fd90 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_open_session () function with ssh_channel_open_session (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_request_exec () + function with ssh_channel_request_exec (). Might break on ancient + systems, but we don't care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 8ca51b8..2f6d3cc 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1611,11 +1611,11 @@ void SshMasterConnection::channelLoop() x2goDebug<<errorMsg<<": "<<err<<endl; #endif } - else if ( channel_request_exec ( channel, channelConnections[i].command.toLatin1() ) != SSH_OK ) + else if ( ssh_channel_request_exec ( channel, channelConnections[i].command.toLatin1() ) != SSH_OK ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "channel_request_exec failed" ); - emit ioErr ( channelConnections[i].creator, errorMsg, err ); + QString errorMsg=tr ( "ssh_channel_request_exec failed" ); + emit ioErr ( channelConnections[i].creator, errorMsg + ".", err ); #ifdef DEBUG x2goDebug<<errorMsg<<": "<<err<<endl; #endif -- 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 feature/libssh-api-upgrade in repository x2goclient. commit 3b037cdb7cefc85801e029dc9a300a48b76dce73 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 17:50:05 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_open_session () function with ssh_channel_open_session (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 06a27f7..284e150 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_open_forward () function with ssh_channel_open_forward (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_open_session () + function with ssh_channel_open_session (). Might break on ancient + systems, but we don't care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index c7d851b..8ca51b8 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1602,11 +1602,11 @@ void SshMasterConnection::channelLoop() #ifdef DEBUG x2goDebug<<"Executing remote: "<<channelConnections.at ( i ).command<<endl; #endif - if ( channel_open_session ( channel ) !=SSH_OK ) + if ( ssh_channel_open_session ( channel ) !=SSH_OK ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "channel_open_session failed." ); - emit ioErr ( channelConnections[i].creator, errorMsg, err ); + QString errorMsg=tr ( "ssh_channel_open_session failed" ); + emit ioErr ( channelConnections[i].creator, errorMsg + ".", err ); #ifdef DEBUG x2goDebug<<errorMsg<<": "<<err<<endl; #endif -- 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 feature/libssh-api-upgrade in repository x2goclient. commit f1abcbd7ba79a32301ec8981f2bc1c01daf39d8c Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 17:54:41 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_poll () function with ssh_channel_poll (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3f7fd90..fc1a4ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_request_exec () function with ssh_channel_request_exec (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_poll () function + with ssh_channel_poll (). Might break on ancient systems, but we don't + care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 2f6d3cc..990fb93 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1657,7 +1657,7 @@ void SshMasterConnection::channelLoop() ssh_channel channel=channelConnections.at ( i ).channel; if ( channel==0l ) continue; - if ( channel_poll ( channel,1 ) >0 ) + if ( ssh_channel_poll ( channel,1 ) > 0 ) { #ifdef DEBUG // x2goDebug<<"read err data from channel\n"; @@ -1668,7 +1668,7 @@ void SshMasterConnection::channelLoop() // x2goDebug<<nbytes<<" err from channel"<<endl; #endif } - int rez=channel_poll ( channel,0 ); + int rez = ssh_channel_poll ( channel, 0 ); if ( rez==SSH_EOF ) { #ifdef DEBUG -- 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 feature/libssh-api-upgrade in repository x2goclient. commit efd41a909bdb69249f2ee1e7f26fbbb64dfab73e Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 18:13:28 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_close () function with ssh_channel_close (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 19c75d1..d5fe8e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -42,6 +42,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_send_eof () function with ssh_channel_send_eof (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_close () + function with ssh_channel_close (). Might break on ancient systems, but + we don't care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index fefa479..292c703 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1797,7 +1797,7 @@ void SshMasterConnection::finalize ( int item ) #ifdef DEBUG x2goDebug<<"EOF sent."; #endif - channel_close ( channel ); + ssh_channel_close ( channel ); #ifdef DEBUG x2goDebug<<"Channel closed."; #endif -- 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 feature/libssh-api-upgrade in repository x2goclient. commit 1d8a37ab475a9bcfdcefda0889076bf90b91908c Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 18:14:56 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_free () function with ssh_channel_free (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d5fe8e6..568bc35 100644 --- a/debian/changelog +++ b/debian/changelog @@ -45,6 +45,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_close () function with ssh_channel_close (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_free () function + with ssh_channel_free (). Might break on ancient systems, but we don't + care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 292c703..93ec02d 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1801,7 +1801,7 @@ void SshMasterConnection::finalize ( int item ) #ifdef DEBUG x2goDebug<<"Channel closed."; #endif - channel_free ( channel ); + ssh_channel_free ( channel ); } if ( tcpSocket>0 ) { -- 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 feature/libssh-api-upgrade in repository x2goclient. commit d14a335f6d645a2b9fc004a858f7166770f21252 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 18:10:26 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_write () function with ssh_channel_write (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1423d8f..1027f28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_is_eof () function with ssh_channel_is_eof (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_write () + function with ssh_channel_write (). Might break on ancient systems, but + we don't care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 90a9f7a..c8379f0 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1746,13 +1746,13 @@ void SshMasterConnection::channelLoop() #endif if ( nbytes > 0 ) { - if ( channel_write ( channel, buffer, nbytes ) !=nbytes ) + if ( ssh_channel_write ( channel, buffer, nbytes ) !=nbytes ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "channel_write failed." ); - emit ioErr ( channelConnections[i].creator, errorMsg, err ); + QString errorMsg=tr ( "ssh_channel_write failed" ); + emit ioErr ( channelConnections[i].creator, errorMsg + ".", err ); #ifdef DEBUG - x2goDebug<<errorMsg<<" - "<<err<<endl; + x2goDebug<<errorMsg<<": "<<err<<endl; #endif finalize ( i ); continue; -- 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 feature/libssh-api-upgrade in repository x2goclient. commit f86895a291277060f29af59fba8433fdfe15f166 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 18:08:26 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_is_eof () function with ssh_channel_is_eof (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ede793d..1423d8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_read () function with ssh_channel_read (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_is_eof () + function with ssh_channel_is_eof (). Might break on ancient systems, but + we don't care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index dd2df0e..90a9f7a 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1724,7 +1724,7 @@ void SshMasterConnection::channelLoop() continue; } - if ( channel_is_eof ( channel ) ) + if ( ssh_channel_is_eof ( channel ) ) { #ifdef DEBUG x2goDebug<<"EOF on channel "<<channel<<"; SshProcess object: "<<channelConnections[i].creator->pid; -- 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 feature/libssh-api-upgrade in repository x2goclient. commit a71ce029b0ea04ff9275521246e427441d18cc09 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 18:12:09 2017 +0100 src/sshmasterconnection.cpp: replace deprecated channel_send_eof () function with ssh_channel_send_eof (). Might break on ancient systems, but we don't care. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1027f28..19c75d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -39,6 +39,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_write () function with ssh_channel_write (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: replace deprecated channel_send_eof () + function with ssh_channel_send_eof (). Might break on ancient systems, + but we don't care. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index c8379f0..fefa479 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1793,7 +1793,7 @@ void SshMasterConnection::finalize ( int item ) ssh_channel channel=channelConnections.at ( item ).channel; if ( channel ) { - channel_send_eof ( channel ); + ssh_channel_send_eof ( channel ); #ifdef DEBUG x2goDebug<<"EOF sent."; #endif -- 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 feature/libssh-api-upgrade in repository x2goclient. commit ed981d141bd7f4f91ff1a44d41660c10b4464a33 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Jan 28 18:34:46 2017 +0100 src/sshmasterconnection.cpp: use QString::arg () to insert function name and thus deduplicate error translation messages. Also re-add the full stop sign and remove it when needed for x2goDebug. --- debian/changelog | 3 +++ src/sshmasterconnection.cpp | 31 ++++++++++++++++--------------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 568bc35..225df66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -48,6 +48,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: replace deprecated channel_free () function with ssh_channel_free (). Might break on ancient systems, but we don't care. + - src/sshmasterconnection.cpp: use QString::arg () to insert function name + and thus deduplicate error translation messages. Also re-add the full + stop sign and remove it when needed for x2goDebug. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 93ec02d..4178730 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -1559,11 +1559,12 @@ void SshMasterConnection::channelLoop() if (!channel) { QString err = ssh_get_error (my_ssh_session); - QString error_msg = tr ("ssh_channel_new failed"); - emit ioErr (channelConnections[i].creator, error_msg + ".", err); + /*: Argument in this context will be a function name. */ + QString error_msg = tr ("%1 failed.").arg ("ssh_channel_new"); + emit ioErr (channelConnections[i].creator, error_msg, err); #ifdef DEBUG - x2goDebug << errorMsg << ": " << err << endl; + x2goDebug << error_msg.left (error_msg.size () - 1) << ": " << err << endl; #endif continue; @@ -1584,10 +1585,10 @@ void SshMasterConnection::channelLoop() channelConnections.at ( i ).localPort ) != SSH_OK ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "ssh_channel_open_forward failed" ); - emit ioErr ( channelConnections[i].creator, errorMsg + ".", err ); + QString errorMsg=tr ( "%1 failed." ).arg ("ssh_channel_open_forward"); + emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG - x2goDebug<<errorMsg<<": "<<err<<endl; + x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": "<<err<<endl; #endif } #ifdef DEBUG @@ -1605,19 +1606,19 @@ void SshMasterConnection::channelLoop() if ( ssh_channel_open_session ( channel ) !=SSH_OK ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "ssh_channel_open_session failed" ); - emit ioErr ( channelConnections[i].creator, errorMsg + ".", err ); + QString errorMsg=tr ( "%1 failed." ).arg ("ssh_channel_open_session"); + emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG - x2goDebug<<errorMsg<<": "<<err<<endl; + x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": "<<err<<endl; #endif } else if ( ssh_channel_request_exec ( channel, channelConnections[i].command.toLatin1() ) != SSH_OK ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "ssh_channel_request_exec failed" ); - emit ioErr ( channelConnections[i].creator, errorMsg + ".", err ); + QString errorMsg=tr ( "%1 failed." ).arg ("ssh_channel_request_exec"); + emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG - x2goDebug<<errorMsg<<": "<<err<<endl; + x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": "<<err<<endl; #endif } #ifdef DEBUG @@ -1749,10 +1750,10 @@ void SshMasterConnection::channelLoop() if ( ssh_channel_write ( channel, buffer, nbytes ) !=nbytes ) { QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "ssh_channel_write failed" ); - emit ioErr ( channelConnections[i].creator, errorMsg + ".", err ); + QString errorMsg=tr ( "%1 failed." ).arg ("ssh_channel_write"); + emit ioErr ( channelConnections[i].creator, errorMsg, err ); #ifdef DEBUG - x2goDebug<<errorMsg<<": "<<err<<endl; + x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": "<<err<<endl; #endif finalize ( i ); continue; -- 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 feature/libssh-api-upgrade in repository x2goclient. commit a5639dea6e7fde937fbaf8c693badfa33b78ae57 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Feb 2 08:09:08 2017 +0100 src/sshmasterconnection.cpp: enable parsing of ~/.ssh/config. Fixes: #1121. Shorthands as host names and other bells and whistles like inferred port or user name values are now supported. --- debian/changelog | 3 + src/sessionwidget.cpp | 19 ++++-- src/sshmasterconnection.cpp | 159 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 153 insertions(+), 28 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9724054..10d1d47 100644 --- a/debian/changelog +++ b/debian/changelog @@ -54,6 +54,9 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: fix up some debug strings. - src/sshmasterconnection.cpp: port more occurrences of "QString to C string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. + - src/sshmasterconnection.cpp: enable parsing of ~/.ssh/config. + Fixes: #1121. Shorthands as host names and other bells and whistles like + inferred port or user name values are now supported. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sessionwidget.cpp b/src/sessionwidget.cpp index 9fd2781..e70aff6 100644 --- a/src/sessionwidget.cpp +++ b/src/sessionwidget.cpp @@ -84,17 +84,23 @@ SessionWidget::SessionWidget ( bool newSession, QString id, ONMainWindow * mw, #else QFrame* sgb=this; #endif + const QString ssh_port_tooltip_text = tr ("Values ranging from <b>0</b> to <b>65535</b> are allowed." + "<br />A value of <b>0</b> will either use the port specified in the " + "SSH configuration file belonging to a host or shortname, " + "or use the default of <b>22</b>."); server=new QLineEdit ( sgb ); uname=new QLineEdit ( sgb ); sshPort=new QSpinBox ( sgb ); sshPort->setValue ( mainWindow->getDefaultSshPort().toInt() ); - sshPort->setMinimum ( 1 ); - sshPort->setMaximum ( 999999999 ); + sshPort->setMinimum ( 0 ); + sshPort->setMaximum ( 65535 ); + sshPort->setToolTip (ssh_port_tooltip_text); #ifdef Q_OS_LINUX rdpPort=new QSpinBox ( sgb ); rdpPort->setValue ( mainWindow->getDefaultSshPort().toInt() ); - rdpPort->setMinimum ( 1 ); - rdpPort->setMaximum ( 999999999 ); + rdpPort->setMinimum ( 0 ); + rdpPort->setMaximum ( 65535 ); + rdpPort->setToolTip (ssh_port_tooltip_text); #endif key=new QLineEdit ( sgb ); @@ -156,8 +162,9 @@ SessionWidget::SessionWidget ( bool newSession, QString id, ONMainWindow * mw, proxyType->addButton(rbHttpProxy); proxyHost=new QLineEdit(proxyBox); proxyPort=new QSpinBox(proxyBox); - proxyPort->setMinimum ( 1 ); - proxyPort->setMaximum ( 999999999 ); + proxyPort->setMinimum ( 0 ); + proxyPort->setMaximum ( 65535 ); + proxyPort->setToolTip (ssh_port_tooltip_text); cbProxySameUser=new QCheckBox(tr("Same login as on X2Go Server"), proxyBox); proxyLogin=new QLineEdit(proxyBox); diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index b08acd0..f16bf85 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -195,14 +195,53 @@ SshMasterConnection::SshMasterConnection (QObject* parent, QString host, int por mainWnd=(ONMainWindow*) parent; kerberos=krblogin; challengeAuthVerificationCode=QString::null; - if(this->user==QString::null||this->user.length()<=0) - { + + if (this->user.isEmpty ()) { + /* We might have a config file request pending, honor this. */ + ssh_session tmp_session = ssh_new (); + + if (!tmp_session) { + QString error_msg = tr ("Cannot create SSH session."); + error_msg += " " + tr ("Using environment-provided username."); +#ifdef DEBUG + x2goDebug << error_msg; +#endif + } + else { + QByteArray tmp_BA; + + if ((useproxy) && (PROXYSSH == proxytype)) { + tmp_BA = this->proxyserver.toLocal8Bit (); + } + else { + tmp_BA = this->host.toLocal8Bit (); + } + + ssh_options_set (tmp_session, SSH_OPTIONS_HOST, tmp_BA.data ()); + + if (ssh_options_parse_config (tmp_session, NULL) < 0) { + x2goDebug << "Warning: unable to parse the SSH config file."; + } + + char *inferred_username = NULL; + ssh_options_get (tmp_session, SSH_OPTIONS_USER, &inferred_username); + x2goDebug << "Temporary session user name after config file parse: " << inferred_username; + + this->user = QString::fromLocal8Bit (inferred_username); + + ssh_string_free_char (inferred_username); + ssh_free (tmp_session); + } + } + + if (this->user.isEmpty ()) { #ifdef Q_OS_WIN - this->user=getenv("USERNAME"); + this->user = getenv ("USERNAME"); #else - this->user=getenv("USER"); + this->user = getenv ("USER"); #endif } + #ifdef DEBUG if (kerberos) { @@ -773,14 +812,30 @@ bool SshMasterConnection::sshConnect() if(useproxy && proxytype==PROXYSSH) { ssh_options_set ( my_ssh_session, SSH_OPTIONS_HOST, "127.0.0.1" ); - ssh_options_set ( my_ssh_session, SSH_OPTIONS_PORT, &localProxyPort ); - + if (localProxyPort) { + ssh_options_set ( my_ssh_session, SSH_OPTIONS_PORT, &localProxyPort ); + } } else { ssh_options_set ( my_ssh_session, SSH_OPTIONS_HOST, tmpBA.data() ); - ssh_options_set ( my_ssh_session, SSH_OPTIONS_PORT, &port ); + if (port) { + ssh_options_set ( my_ssh_session, SSH_OPTIONS_PORT, &port ); + } + } + + unsigned int cur_port = 0; + ssh_options_get_port (my_ssh_session, &cur_port); + x2goDebug << "Session port before config file parse: " << cur_port; + + /* Parse ~/.ssh/config. */ + if (ssh_options_parse_config (my_ssh_session, NULL) < 0) { + x2goDebug << "Warning: unable to parse the SSH config file."; } + + ssh_options_get_port (my_ssh_session, &cur_port); + x2goDebug << "Session port after config file parse: " << cur_port; + rc = ssh_connect ( my_ssh_session ); if ( rc != SSH_OK ) { @@ -790,9 +845,22 @@ bool SshMasterConnection::sshConnect() if(useproxy && proxytype==PROXYSSH) { ssh_options_set ( my_ssh_session, SSH_OPTIONS_HOST, tmpBA.data() ); - ssh_options_set ( my_ssh_session, SSH_OPTIONS_PORT, &port ); + if (port) { + ssh_options_set ( my_ssh_session, SSH_OPTIONS_PORT, &port ); + } + } + + ssh_options_get_port (my_ssh_session, &cur_port); + x2goDebug << "Session port before config file parse (part 2): " << cur_port; + /* Parse ~/.ssh/config. */ + if (ssh_options_parse_config (my_ssh_session, NULL) < 0) { + x2goDebug << "Warning: unable to parse the SSH config file."; } + + ssh_options_get_port (my_ssh_session, &cur_port); + x2goDebug << "Session port after config file parse (part 2): " << cur_port; + return true; } @@ -1581,25 +1649,72 @@ void SshMasterConnection::channelLoop() if ( tcpSocket>0 ) { #ifdef DEBUG - x2goDebug<<"Forwarding new channel, local port: "<<channelConnections.at ( i ).localPort<<endl; + x2goDebug << "Forwarding parameters: from remote (" << channelConnections.at (i).forwardHost << ":" + << channelConnections.at (i).forwardPort << ") to local (" + << channelConnections.at (i).localHost << ":" << channelConnections.at (i).localPort + << ")"; #endif - if ( ssh_channel_open_forward ( channel, - channelConnections.at ( i ).forwardHost.toLatin1(), - channelConnections.at ( i ).forwardPort, - channelConnections.at ( i ).localHost.toLatin1(), - channelConnections.at ( i ).localPort ) != SSH_OK ) - { - QString err=ssh_get_error ( my_ssh_session ); - QString errorMsg=tr ( "%1 failed." ).arg ("ssh_channel_open_forward"); - emit ioErr ( channelConnections[i].creator, errorMsg, err ); + ssh_session tmp_session = ssh_new (); + + if (!tmp_session) { + QString error_msg = tr ("Cannot create SSH session."); #ifdef DEBUG - x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": "<<err<<endl; + x2goDebug << error_msg; #endif + emit ioErr (channelConnections[i].creator, error_msg, ""); } -#ifdef DEBUG - else + else { + QByteArray tmp_BA = channelConnections.at (i).forwardHost.toLocal8Bit (); + const int tmp_port = channelConnections.at (i).forwardPort; + + ssh_options_set (tmp_session, SSH_OPTIONS_HOST, tmp_BA.data ()); + + if (tmp_port) { + ssh_options_set (tmp_session, SSH_OPTIONS_PORT, &tmp_port); + } + + /* The host and port might be a shorthand and zero, so fetch the actual data. */ + if (ssh_options_parse_config (tmp_session, NULL) < 0) { + x2goDebug << "Warning: unable to parse the SSH config file."; + } + + unsigned int inferred_port = 0; + ssh_options_get_port (tmp_session, &inferred_port); + x2goDebug << "Temporary session port after config file parse: " << inferred_port; + + char *inferred_host = NULL; + ssh_options_get (tmp_session, SSH_OPTIONS_HOST, &inferred_host); + x2goDebug << "Temporary session host after config file parse: " << inferred_host; + + channelConnections[i].forwardHost = QString (inferred_host); + channelConnections[i].forwardPort = static_cast<int> (inferred_port); + + ssh_string_free_char (inferred_host); + ssh_free (tmp_session); + } + { - x2goDebug<<"New channel forwarded."<<endl; + QByteArray tmp_BA_forward = channelConnections.at (i).forwardHost.toLocal8Bit (); + QByteArray tmp_BA_local = channelConnections.at (i).localHost.toLocal8Bit (); + + if ( ssh_channel_open_forward ( channel, + tmp_BA_forward.data (), + channelConnections.at ( i ).forwardPort, + tmp_BA_local.data (), + channelConnections.at ( i ).localPort ) != SSH_OK ) + { + QString err=ssh_get_error ( my_ssh_session ); + QString errorMsg=tr ( "%1 failed." ).arg ("ssh_channel_open_forward"); + emit ioErr ( channelConnections[i].creator, errorMsg, err ); +#ifdef DEBUG + x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": "<<err<<endl; +#endif + } +#ifdef DEBUG + else + { + x2goDebug<<"New channel forwarded."<<endl; + } } #endif } -- 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 feature/libssh-api-upgrade in repository x2goclient. commit a5b4d79ff5fd82f15016b209ce3de036839d8a09 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Feb 2 08:06:03 2017 +0100 src/sshmasterconnection.cpp: port more occurrences of "QString to C string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. --- debian/changelog | 2 ++ src/sshmasterconnection.cpp | 31 ++++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1a9b5ab..9724054 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,8 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium and thus deduplicate error translation messages. Also re-add the full stop sign and remove it when needed for x2goDebug. - src/sshmasterconnection.cpp: fix up some debug strings. + - src/sshmasterconnection.cpp: port more occurrences of "QString to C + string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 543be5c..b08acd0 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -541,16 +541,20 @@ void SshMasterConnection::run() } #ifdef Q_OS_WIN - ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, (mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit()); + { + QByteArray tmp_BA = (mainWnd->getHomeDirectory () + "/ssh").toLocal8Bit (); + + ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, tmp_BA.data ()); #ifdef DEBUG - x2goDebug<<"Setting SSH directory to "<<(mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit(); + x2goDebug << "Setting SSH directory to " << tmp_BA.data (); #endif - if (kerberos) - { - parseKnownHosts(); + if (kerberos) + { + parseKnownHosts(); + } } - #endif + ssh_options_set(my_ssh_session, SSH_OPTIONS_LOG_VERBOSITY, &verbosity); ssh_options_set(my_ssh_session, SSH_OPTIONS_TIMEOUT, &timeout); @@ -652,17 +656,18 @@ void SshMasterConnection::run() return; } -#ifdef Q_OS_WIN - ssh_options_set ( my_ssh_session, SSH_OPTIONS_USER, user.toLocal8Bit() ); -#else - ssh_options_set ( my_ssh_session, SSH_OPTIONS_USER, user.toLatin1() ); -#endif + QByteArray tmp_BA = user.toLocal8Bit (); + ssh_options_set ( my_ssh_session, SSH_OPTIONS_USER, tmp_BA.data () ); #ifdef Q_OS_WIN - ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, (mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit()); + { + QByteArray tmp_BA = (mainWnd->getHomeDirectory () + "/ssh").toLocal8Bit (); + + ssh_options_set ( my_ssh_session, SSH_OPTIONS_SSH_DIR, tmp_BA.data () ); #ifdef DEBUG - x2goDebug<<"Setting SSH directory to "<<(mainWnd->getHomeDirectory()+"/ssh").toLocal8Bit(); + x2goDebug << "Setting SSH directory to " << tmp_BA.data (); #endif + } #endif if ( userAuth() ) -- 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 feature/libssh-api-upgrade in repository x2goclient. commit bb727e5380916de20243caf949d8efb2e94a5825 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Feb 2 06:56:32 2017 +0100 src/sshmasterconnection.cpp: fix up some debug strings. --- debian/changelog | 1 + src/sshmasterconnection.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 225df66..1a9b5ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -51,6 +51,7 @@ x2goclient (4.1.0.1-0x2go1) UNRELEASED; urgency=medium - src/sshmasterconnection.cpp: use QString::arg () to insert function name and thus deduplicate error translation messages. Also re-add the full stop sign and remove it when needed for x2goDebug. + - src/sshmasterconnection.cpp: fix up some debug strings. -- X2Go Release Manager <git-admin@x2go.org> Wed, 22 Feb 2017 07:13:10 +0100 diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp index 4178730..543be5c 100644 --- a/src/sshmasterconnection.cpp +++ b/src/sshmasterconnection.cpp @@ -173,9 +173,9 @@ SshMasterConnection::SshMasterConnection (QObject* parent, QString host, int por breakLoop=false; kerberosDelegation=false; - x2goDebug << "SshMasterConnection, host " << host << "port " << port << "user " << user - << "useproxy " << useproxy << "proxyserver " << proxyserver - << "proxyport " << proxyport; + x2goDebug << "SshMasterConnection, host " << host << "; port " << port << "; user " << user + << "; useproxy " << useproxy << "; proxyserver " << proxyserver + << "; proxyport " << proxyport; this->host=host; this->port=port; this->user=user; @@ -467,7 +467,7 @@ void SshMasterConnection::run() #endif if(useproxy && proxytype==PROXYSSH) { - x2goDebug << "proxyserver: " << proxyserver << "proxyport: " << proxyport << "proxylogin: " << proxylogin; + x2goDebug << "proxyserver: " << proxyserver << "; proxyport: " << proxyport << "; proxylogin: " << proxylogin; sshProxy=new SshMasterConnection (0, proxyserver, proxyport,acceptUnknownServers, proxylogin, proxypassword, proxykey, proxyautologin, proxyKrbLogin, false); connect ( sshProxy, SIGNAL ( connectionOk(QString) ), this, SLOT ( slotSshProxyConnectionOk() ) ); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git