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 5479c31 src/sshmasterconnection.cpp: enable parsing of ~/.ssh/config. Fixes: #1121. discards fc84c24 src/sshmasterconnection.cpp: port more occurrences of "QString to C string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. discards bd335f0 src/sshmasterconnection.cpp: fix up some debug strings. discards b1e826e src/sshmasterconnection.cpp: use QString::arg () to insert function name and thus deduplicate error translation messages. discards ae43804 src/sshmasterconnection.cpp: replace deprecated channel_free () function with ssh_channel_free (). discards a5ecc9f src/sshmasterconnection.cpp: replace deprecated channel_close () function with ssh_channel_close (). discards 9ab0859 src/sshmasterconnection.cpp: replace deprecated channel_send_eof () function with ssh_channel_send_eof (). discards d6ef7cf src/sshmasterconnection.cpp: replace deprecated channel_write () function with ssh_channel_write (). discards 6770e23 src/sshmasterconnection.cpp: replace deprecated channel_is_eof () function with ssh_channel_is_eof (). discards 9c326fd src/sshmasterconnection.cpp: replace deprecated channel_read () function with ssh_channel_read (). discards a34bb98 src/sshmasterconnection.cpp: replace deprecated channel_poll () function with ssh_channel_poll (). discards 6e8faf2 src/sshmasterconnection.cpp: replace deprecated channel_request_exec () function with ssh_channel_request_exec (). discards e753fe2 src/sshmasterconnection.cpp: replace deprecated channel_open_session () function with ssh_channel_open_session (). discards 0c9dc98 src/sshmasterconnection.cpp: replace deprecated channel_open_forward () function with ssh_channel_open_forward (). discards d1e7566 src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new (). discards 530a5e6 src/sshmasterconnection.cpp: replace string_free () with its successor ssh_string_free (). discards d8d30e3 src/sshmasterconnection.cpp: with libssh 0.6.0 and newer, get the public key via ssh_get_server_publickey () (0.7.4 and higher) or ssh_get_publickey () (0.7.3 and lower) and its hash via ssh_get_publickey_hash () instead of using the deprecated ssh_get_pubkey_hash () function. new 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. new 33907e6 src/sshmasterconnection.cpp: replace string_free () with its successor ssh_string_free (). new 8063573 src/sshmasterconnection.cpp: replace deprecated channel_new () function with ssh_channel_new (). new 49e2cd6 src/sshmasterconnection.cpp: replace deprecated channel_open_forward () function with ssh_channel_open_forward (). new 81796f5 src/sshmasterconnection.cpp: replace deprecated channel_open_session () function with ssh_channel_open_session (). new 4462ca3 src/sshmasterconnection.cpp: replace deprecated channel_request_exec () function with ssh_channel_request_exec (). new 2fd60e8 src/sshmasterconnection.cpp: replace deprecated channel_poll () function with ssh_channel_poll (). new 2ba4653 src/sshmasterconnection.cpp: replace deprecated channel_read () function with ssh_channel_read (). new 6e894f1 src/sshmasterconnection.cpp: replace deprecated channel_is_eof () function with ssh_channel_is_eof (). new e823424 src/sshmasterconnection.cpp: replace deprecated channel_write () function with ssh_channel_write (). new 5da95dd src/sshmasterconnection.cpp: replace deprecated channel_send_eof () function with ssh_channel_send_eof (). new d3d5a51 src/sshmasterconnection.cpp: replace deprecated channel_close () function with ssh_channel_close (). new 0748074 src/sshmasterconnection.cpp: replace deprecated channel_free () function with ssh_channel_free (). new d4ce55b src/sshmasterconnection.cpp: use QString::arg () to insert function name and thus deduplicate error translation messages. new 56e2dc3 src/sshmasterconnection.cpp: fix up some debug strings. new 284c090 src/sshmasterconnection.cpp: port more occurrences of "QString to C string" akin to 1b21d75f2c10609f3586f5b5e0b4ceb7fca83fdd. new fbb7b42 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 (5479c31) \ N -- N -- N refs/heads/feature/libssh-api-upgrade (fbb7b42) 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 17 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 | 4 ++-- src/sshmasterconnection.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 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 8063573a5363b1a9819528e75ec357e9d7bcaf09 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 cb8bc9f..da6323a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -573,6 +573,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 11ca6177f80cac5c44516d9a6a86cab32c7c99e8 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 db1b531..62b8a77 100644 --- a/debian/changelog +++ b/debian/changelog @@ -562,6 +562,15 @@ x2goclient (4.1.0.0-0x2go1) UNRELEASED; urgency=medium time. - 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 33907e6d6a920c9c097027c42946a9f9619118e8 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 62b8a77..cb8bc9f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -571,6 +571,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 49e2cd65c436f56646b8f13c15f5ab80944e2ff1 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 da6323a..277b592 100644 --- a/debian/changelog +++ b/debian/changelog @@ -576,6 +576,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 6e894f142458c9f526eeb0acb909e528456706a8 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 182f22b..0882e81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -591,6 +591,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 81796f5687d84697e9d6fa2d268c9fb56cf0592d 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 277b592..6c96f70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -579,6 +579,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 4462ca32dc263af78b05758833a3f0d59ff50d79 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 6c96f70..e84c4c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -582,6 +582,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 2fd60e85b29f705b39291ece9da4efb6aef4ee72 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 e84c4c1..65d63b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -585,6 +585,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 2ba4653557be21c78a8005a3f8ec64254778d78b 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 65d63b3..182f22b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -588,6 +588,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 e8234246e4a8b67e29826396cb8e35e8f96bbe72 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 0882e81..c54e598 100644 --- a/debian/changelog +++ b/debian/changelog @@ -594,6 +594,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 5da95dd67021db42c44f9cd12048fb9e08f3016c 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 c54e598..1cdfc57 100644 --- a/debian/changelog +++ b/debian/changelog @@ -597,6 +597,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 07480747482b2304d5dba8e4ee0be52d213a57ac 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 5401c66..8464b1b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -603,6 +603,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 d3d5a51743da0ae8c7631526767ad574276324c8 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 1cdfc57..5401c66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -600,6 +600,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 fbb7b42e94187fb16debf7a9f0726279aecf1ef3 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 | 148 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 143 insertions(+), 27 deletions(-) diff --git a/debian/changelog b/debian/changelog index 75d4164..1e7ab6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -612,6 +612,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..acda638 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; } @@ -1583,23 +1651,61 @@ void SshMasterConnection::channelLoop() #ifdef DEBUG x2goDebug<<"Forwarding new channel, local port: "<<channelConnections.at ( i ).localPort<<endl; #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 (); + ssh_options_set (tmp_session, SSH_OPTIONS_HOST, tmp_BA.data ()); + + /* 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 284c0901cc68205bd3afa908c0efbcf00f8a18e0 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 55133b6..75d4164 100644 --- a/debian/changelog +++ b/debian/changelog @@ -610,6 +610,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 56e2dc3cb9d1b45d0570d66c3a7e0182726205e2 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 2463d4f..55133b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -609,6 +609,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 d4ce55bcb8626ac17d0be42ec6e05c36870eb2f7 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 8464b1b..2463d4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -606,6 +606,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