[X2Go-Commits] [x2goclient] 06/06: Improve debugging/logging the SSH connections made by X2Go Client.
git-admin at x2go.org
git-admin at x2go.org
Thu Jan 8 13:12:26 CET 2015
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2goclient.
commit ae2c22bced1099055d49fad3f3ff815054aa136b
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Thu Jan 8 13:08:19 2015 +0100
Improve debugging/logging the SSH connections made by X2Go Client.
---
debian/changelog | 1 +
onmainwindow.cpp | 10 ++++++++--
sshmasterconnection.cpp | 4 ++--
sshprocess.cpp | 8 ++++++--
4 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index ebf1c61..3e67cf4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -25,6 +25,7 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium
exist on the client. (Partially solves #405).
- Fix string concatenation/layout of error message when tunnel I/O errors
occur.
+ - Improve debugging/logging the SSH connections made by X2Go Client.
[ Jason Alavaliant ]
* New upstream verson (4.0.3.2):
diff --git a/onmainwindow.cpp b/onmainwindow.cpp
index 9bde5b2..74cd535 100644
--- a/onmainwindow.cpp
+++ b/onmainwindow.cpp
@@ -7843,7 +7843,7 @@ directory* ONMainWindow::getExpDir ( QString key )
void ONMainWindow::slotRetExportDir ( bool result,QString output,
int pid)
{
-
+ x2goDebug<<"Post-cleanup for startX2goMount triggered."<<endl;
QString key;
for ( int i=0; i<exportDir.size(); ++i )
if ( exportDir[i].pid==pid )
@@ -7853,10 +7853,10 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output,
break;
}
-
if ( result==false )
{
QString message=tr ( "<b>Connection failed</b>\n" ) +output;
+ x2goDebug<<"startX2goMount failed to mount client-side folder, reason: "<<message<<endl;
if ( message.indexOf ( "publickey,password" ) !=-1 )
{
message=tr ( "<b>Wrong password!</b><br><br>" ) +
@@ -7868,6 +7868,7 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output,
QMessageBox::NoButton );
}
QFile file ( key+".pub" );
+ x2goDebug<<"Deactivating public key from "<<key<<".pub again."<<endl;
if ( !file.open ( QIODevice::ReadOnly | QIODevice::Text ) )
{
printSshDError_noExportPubKey();
@@ -9028,6 +9029,8 @@ void ONMainWindow::slotFsTunnelFailed ( bool result, QString output,
void ONMainWindow::slotFsTunnelOk(int)
{
+ x2goDebug<<"FS tunnel through SSH seems to be up and running..."<<endl;
+
fsTunReady=true;
//start reverse mounting if RSA Key and FS tunnel are ready
//start only once from slotFsTunnelOk() or slotCopyKey().
@@ -9086,6 +9089,8 @@ void ONMainWindow::startX2goMount()
out<<line;
file1.close();
+ x2goDebug<<"Temporarily activated public key from file "<<fsExportKey<<".pub."<<endl;
+
QString passwd=getCurrentPass();
QString user=getCurrentUname();
QString host=resumingSession.server;
@@ -9177,6 +9182,7 @@ void ONMainWindow::startX2goMount()
}
}
+ x2goDebug<<"Calling startX2goMount command."<<endl;
dir->pid=sshConnection->executeCommand(cmd,this,SLOT ( slotRetExportDir ( bool,
QString,int) ));
}
diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp
index 2c8f3a3..63bb20d 100755
--- a/sshmasterconnection.cpp
+++ b/sshmasterconnection.cpp
@@ -1538,7 +1538,7 @@ void SshMasterConnection::channelLoop()
if ( rez==SSH_EOF )
{
#ifdef DEBUG
- x2goDebug<<"EOF ON CHANNEL "<<channel<<endl;
+ x2goDebug<<"EOF ON CHANNEL "<<channel<<" (SshProcess: "<<channelConnections[i].creator->pid<<")"<<endl;
#endif
//////Finished////////
finalize ( i );
@@ -1593,7 +1593,7 @@ void SshMasterConnection::channelLoop()
if ( channel_is_eof ( channel ) )
{
#ifdef DEBUG
- x2goDebug<<"EOF ON CHANNEL "<<channel<<endl;
+ x2goDebug<<"EOF ON CHANNEL "<<channel<<" (SshProcess: "<<channelConnections[i].creator->pid<<")"<<endl;
#endif
//////Finished////////
finalize ( i );
diff --git a/sshprocess.cpp b/sshprocess.cpp
index 84af170..310f83f 100755
--- a/sshprocess.cpp
+++ b/sshprocess.cpp
@@ -186,7 +186,7 @@ void SshProcess::startNormal(const QString& cmd)
//#ifdef DEBUG
// ONLY UNCOMMENT FOR TESTING, MIGHT REVEAL PASSWORD WHEN command=RDP
-// x2goDebug<<"executing remote command: "<<shcmd<<endl;
+ x2goDebug<<"executing remote command via SshProcess object ("<<pid<<"): "<<cmd<<endl;
// #endif
if(!masterCon->useKerberos())
{
@@ -239,6 +239,8 @@ void SshProcess::startNormal(const QString& cmd)
void SshProcess::start_cp(QString src, QString dst)
{
+ x2goDebug<<"copying file via SshProcess object ("<<pid<<"): "<<src<<" -> "<<dst<<endl;
+
scpSource=src;
if(!masterCon->useKerberos())
{
@@ -287,6 +289,8 @@ void SshProcess::start_cp(QString src, QString dst)
void SshProcess::startTunnel(const QString& forwardHost, uint forwardPort, const QString& localHost,
uint localPort, bool reverse)
{
+ x2goDebug<<"Starting tunnel via SshProcess object ("<<pid<<"): "<<forwardHost<<":"<<forwardPort<<" -> "<<localHost<<":"<<localPort<<endl;
+
tunnel=true;
tunnelOkEmited=false;
if(!masterCon->useKerberos())
@@ -440,7 +444,7 @@ void SshProcess::slotChannelClosed(SshProcess* creator, QString uuid)
}
}
#ifdef DEBUG
- x2goDebug<<"ssh finished:"<<normalExited<<" - "<<output<<uuid<<endl;
+ x2goDebug<<"ssh finished: "<<normalExited<<" - "<<output<<" ("<<pid<<")."<<endl;
#endif
emit sshFinished(normalExited, output, pid);
}
--
Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list