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 fbb7b42 src/sshmasterconnection.cpp: enable parsing of ~/.ssh/config. Fixes: #1121. discards 284c090 src/sshmasterconnection.cpp: port more occurrences of "QString to C string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. discards 56e2dc3 src/sshmasterconnection.cpp: fix up some debug strings. discards d4ce55b src/sshmasterconnection.cpp: use QString::arg () to insert function name and thus deduplicate error translation messages. discards 0748074 src/sshmasterconnection.cpp: replace deprecated channel_free () function with ssh_channel_free (). discards d3d5a51 src/sshmasterconnection.cpp: replace deprecated channel_close () function with ssh_channel_close (). discards 5da95dd src/sshmasterconnection.cpp: replace deprecated channel_send_eof () function with ssh_channel_send_eof (). discards e823424 src/sshmasterconnection.cpp: replace deprecated channel_write () function with ssh_channel_write (). discards 6e894f1 src/sshmasterconnection.cpp: replace deprecated channel_is_eof () function with ssh_channel_is_eof (). discards 2ba4653 src/sshmasterconnection.cpp: replace deprecated channel_read () function with ssh_channel_read (). discards 2fd60e8 src/sshmasterconnection.cpp: replace deprecated channel_poll () function with ssh_channel_poll (). discards 4462ca3 src/sshmasterconnection.cpp: replace deprecated channel_request_exec () function with ssh_channel_request_exec (). discards 81796f5 src/sshmasterconnection.cpp: replace deprecated channel_open_session () function with ssh_channel_open_session (). discards 49e2cd6 src/sshmasterconnection.cpp: replace deprecated channel_open_forward () function with ssh_channel_open_forward (). discards 8063573 src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new (). discards 33907e6 src/sshmasterconnection.cpp: replace string_free () with its successor ssh_string_free (). discards 11ca617 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 93dd915 src/sshmasterconnection.cpp: use ssh_channel_listen_forward () instead of ssh_forward_listen () for newer libssh versions. Fixes: #870. adds 44708d6 res/i18n/x2goclient_es.ts: update Spanish translation file. adds 3131bde res/i18n/x2goclient_es.ts: remove obsolete comments and very minor whitespace fixup. adds 6ef548f res/i18n/x2goclient_de.ts: update German translation file. adds b5435f5 res/i18n/x2goclient_de.ts: fixup German translation file, including typo, whitespace, grammar fixes and other stuff. new 415cced src/sshmasterconnection.cpp: use ssh_channel_listen_forward () instead of ssh_forward_listen () for newer libssh versions. Fixes: #870. new 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. new de301a6 src/sshmasterconnection.cpp: replace string_free () with its successor ssh_string_free (). new 243a925 src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new (). new deaf15a src/sshmasterconnection.cpp: replace deprecated channel_open_forward () function with ssh_channel_open_forward (). new 974d77e src/sshmasterconnection.cpp: replace deprecated channel_open_session () function with ssh_channel_open_session (). new 379900b src/sshmasterconnection.cpp: replace deprecated channel_request_exec () function with ssh_channel_request_exec (). new 56369bd src/sshmasterconnection.cpp: replace deprecated channel_poll () function with ssh_channel_poll (). new 54ce362 src/sshmasterconnection.cpp: replace deprecated channel_read () function with ssh_channel_read (). new 56c01f2 src/sshmasterconnection.cpp: replace deprecated channel_is_eof () function with ssh_channel_is_eof (). new e383a8f src/sshmasterconnection.cpp: replace deprecated channel_write () function with ssh_channel_write (). new a51c90f src/sshmasterconnection.cpp: replace deprecated channel_send_eof () function with ssh_channel_send_eof (). new 19f371d src/sshmasterconnection.cpp: replace deprecated channel_close () function with ssh_channel_close (). new cf680f0 src/sshmasterconnection.cpp: replace deprecated channel_free () function with ssh_channel_free (). new 6990f50 src/sshmasterconnection.cpp: use QString::arg () to insert function name and thus deduplicate error translation messages. new 84fbe9c src/sshmasterconnection.cpp: fix up some debug strings. new 9964ebe src/sshmasterconnection.cpp: port more occurrences of "QString to C string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. new d821bc3 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 (fbb7b42) \ N -- N -- N refs/heads/feature/libssh-api-upgrade (d821bc3) 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: debian/changelog | 9 ++ res/i18n/x2goclient_de.ts | 221 +++++++++++++++++++++++++------------------ res/i18n/x2goclient_es.ts | 54 +++++------ src/sshmasterconnection.cpp | 11 ++- 4 files changed, 173 insertions(+), 122 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 415cced86f4c448722eb1752fc3d079d86fe9b38 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 | 2 ++ src/sshmasterconnection.cpp | 35 ++++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9239577..ce71471 100644 --- a/debian/changelog +++ b/debian/changelog @@ -564,6 +564,8 @@ x2goclient (4.1.0.0-0x2go1) UNRELEASED; urgency=medium whitespace fixup. - res/i18n/x2goclient_de.ts: fixup German translation file, including typo, whitespace, grammar fixes and other stuff. + - src/sshmasterconnection.cpp: use ssh_channel_listen_forward () instead + of ssh_forward_listen () for newer libssh versions. Fixes: #870. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 9cd893057b512f366541289f45a9d7878c1b91aa 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 ce71471..a7d6350 100644 --- a/debian/changelog +++ b/debian/changelog @@ -566,6 +566,15 @@ x2goclient (4.1.0.0-0x2go1) UNRELEASED; urgency=medium typo, whitespace, grammar fixes and other stuff. - 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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 de301a6c97b465e9decbd82b8481298cba255a48 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 a7d6350..e7daad4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -575,6 +575,8 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 243a9256b8b6702ac65d70ce69bea9d707291cec 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 e7daad4..50412e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -577,6 +577,9 @@ x2goclient (4.1.0.0-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... [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 deaf15a530eb2f23164918fd84c8835bd3f21cb9 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 50412e0..ee7ad8c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -580,6 +580,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 974d77e7156b7fb6a7f74a6d628be90b9e94de71 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 ee7ad8c..3e51930 100644 --- a/debian/changelog +++ b/debian/changelog @@ -583,6 +583,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 379900b28203f4c2915380edce3be26ec515c0bb 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 3e51930..f9dbe0f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -586,6 +586,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 56369bd032b118794207b5442b20ee842b735c2d 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 f9dbe0f..9d9edab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -589,6 +589,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 54ce36270409bd2641b9e6a4e89da4eeb0673670 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 9d9edab..b315890 100644 --- a/debian/changelog +++ b/debian/changelog @@ -592,6 +592,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 56c01f28217590b724d593e4db1be743b53c86bf 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 b315890..c445dde 100644 --- a/debian/changelog +++ b/debian/changelog @@ -595,6 +595,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 e383a8f599bbf75a5e8a494f0ab76342c533e51b 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 c445dde..e4171c9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -598,6 +598,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 a51c90f4fa3034574966b3c6fcf371c43b169e1d 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 e4171c9..1fe2834 100644 --- a/debian/changelog +++ b/debian/changelog @@ -601,6 +601,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 19f371d91a58a3ee59f298eb8f1f06f50f538aa2 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 1fe2834..0051130 100644 --- a/debian/changelog +++ b/debian/changelog @@ -604,6 +604,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 cf680f0be29d5892d93b06c59d471d06078bbf97 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 0051130..b847c80 100644 --- a/debian/changelog +++ b/debian/changelog @@ -607,6 +607,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 6990f5008222e30fd5d411860ae7a3fe74ef41e0 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 b847c80..a47fabf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -610,6 +610,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 84fbe9c258a9455f1656f388ac594e1e43dfa076 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 a47fabf..99f81cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -613,6 +613,7 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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
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 9964ebe246e736d66abe113286def8ead2ea6f1d 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 99f81cb..80f3d64 100644 --- a/debian/changelog +++ b/debian/changelog @@ -614,6 +614,8 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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 d821bc37e1d40a7e633675eb3d928d7075a798b7 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 80f3d64..d2c3060 100644 --- a/debian/changelog +++ b/debian/changelog @@ -616,6 +616,9 @@ x2goclient (4.1.0.0-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. [ Bernard Cafarelli ] * New upstream version (4.1.0.0): 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