[X2Go-Commits] [x2goclient] 01/06: Add cygwin sshd logging

git-admin at x2go.org git-admin at x2go.org
Wed May 18 21:17:51 CEST 2016


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch release/4.0.5.1-mswin
in repository x2goclient.

commit 8648bbe12f12f5e5ef71dacd01ce3b15488c11eb
Author: Mike DePaulo <mikedep333 at gmail.com>
Date:   Sat Mar 26 11:14:40 2016 -0400

    Add cygwin sshd logging
---
 src/help.cpp         |    3 ++-
 src/onmainwindow.cpp |   20 ++++++++++++++++++++
 src/onmainwindow.h   |    3 +++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/src/help.cpp b/src/help.cpp
index 20df01e..ce5e071 100644
--- a/src/help.cpp
+++ b/src/help.cpp
@@ -107,7 +107,8 @@ help::params_t help::build_params () {
   }
 
   ADD_OPT ("--help-pack", "Shows available pack methods.");
-  ADD_OPT ("--debug", "Enables extensive debug output to the console. On Windows also enables PulseAudio logging to a file in the \".x2go/pulse\" in the USERPROFILE directory." NEWLINE
+  ADD_OPT ("--debug", "Enables extensive debug output to the console." NEWLINE
+                      "On Windows, also enables PulseAudio logging to a file under \".x2go/pulse\" & cygwin sshd logging to a file under \".x2go/sshLogs\" directory, both under the USERPROFILE directory." NEWLINE
                       "The logs are not deleted when X2Go Client terminates.");
   ADD_OPT ("--no-menu", "Hides menu bar.");
   ADD_OPT ("--no-session-edit", "Disables session editing.");
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index be4de32..cf9b7fe 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -10299,7 +10299,27 @@ bool ONMainWindow::startSshd()
     std::string config="\""+cygwinPath(etcDir+"/sshd_config").toStdString()+"\"";
     std::string key="\""+cygwinPath(etcDir+"/ssh_host_dsa_key").toStdString()+"\"";
 
+    // generate a unique sshLog filepath, and create its directory
+    if (debugging)
+    {
+        QDir* sshLogsDir= new QDir( homeDir+"/.x2go/sshLogs" );
+        if (!sshLogsDir->exists())
+            sshLogsDir->mkpath(".");
+
+        QTemporaryFile* sshLogTemp=new QTemporaryFile ( sshLogsDir->absolutePath()+"/XXXXXX.log" );
+        sshLogTemp->open();
+        sshLog=sshLogTemp->fileName();
+        sshLogTemp->close();
+
+        delete sshLogsDir;
+        delete sshLogTemp;
+        x2goDebug<<"Logging cygwin sshd to: "<<sshLog;
+    }
+
     strm<<clientdir<<"\\sshd.exe -D -p "<<clientSshPort.toInt()<<" -f "<< config <<" -h "<<key;
+    if (debugging){
+        strm<<" -E "<<sshLog.toStdString();
+    }
 
     STARTUPINFOA si;
     std::string desktopName="x2go_";
diff --git a/src/onmainwindow.h b/src/onmainwindow.h
index 23d97f3..809fe5f 100644
--- a/src/onmainwindow.h
+++ b/src/onmainwindow.h
@@ -634,6 +634,9 @@ private:
     QString sshPort;
     QString clientSshPort;
     QString defaultSshPort;
+#ifdef Q_OS_WIN
+    QString sshLog;
+#endif
     QVBoxLayout* selectSesDlgLayout;
     SshMasterConnection* sshConnection;
     QList<SshMasterConnection*> serverSshConnections;

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list