[X2Go-Commits] [x2goclient] 01/02: Revert "Fix quotes when calling remote commands via SSH. Use single backslash to quote quotation marks. (Fixes: #720)."

git-admin at x2go.org git-admin at x2go.org
Fri Jan 9 21:41:53 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 1996489ed6788edff701cf8ad7c8cd5d3071876b
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Fri Jan 9 21:39:58 2015 +0100

    Revert "Fix quotes when calling remote commands via SSH. Use single backslash to quote quotation marks. (Fixes: #720)."
    
    This reverts commit 89105aa63ae77a40327fa680bc71e852957911c5.
---
 debian/changelog        |    2 --
 httpbrokerclient.cpp    |    4 ++--
 sshmasterconnection.cpp |    2 +-
 sshprocess.cpp          |    4 ++--
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f16eca7..3e67cf4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -26,8 +26,6 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium
     - Fix string concatenation/layout of error message when tunnel I/O errors
       occur.
     - Improve debugging/logging the SSH connections made by X2Go Client.
-    - Fix quotes when calling remote commands via SSH. Use single backslash
-      to quote quotation marks. (Fixes: #720).
 
   [ Jason Alavaliant ]
   * New upstream verson (4.0.3.2):
diff --git a/httpbrokerclient.cpp b/httpbrokerclient.cpp
index 5f009d4..736f5e7 100644
--- a/httpbrokerclient.cpp
+++ b/httpbrokerclient.cpp
@@ -302,10 +302,10 @@ void HttpBrokerClient::selectUserSession(const QString& session)
     else
     {
         if (nextAuthId.length() > 0) {
-            sshConnection->executeCommand ( config->sshBrokerBin+" --user "+ brokerUser +" --authid "+nextAuthId+ " --task selectsession --sid \""+session+"\"",
+            sshConnection->executeCommand ( config->sshBrokerBin+" --user "+ brokerUser +" --authid "+nextAuthId+ " --task selectsession --sid \\\""+session+"\\\"",
                                             this,SLOT ( slotSelectSession(bool,QString,int)));
         } else {
-            sshConnection->executeCommand ( config->sshBrokerBin+" --user "+ brokerUser +" --task selectsession --sid \""+session+"\"",
+            sshConnection->executeCommand ( config->sshBrokerBin+" --user "+ brokerUser +" --task selectsession --sid \\\""+session+"\\\"",
                                             this,SLOT ( slotSelectSession(bool,QString,int)));
         }
     }
diff --git a/sshmasterconnection.cpp b/sshmasterconnection.cpp
index b09f04f..9ad8c1f 100755
--- a/sshmasterconnection.cpp
+++ b/sshmasterconnection.cpp
@@ -1139,7 +1139,7 @@ bool SshMasterConnection::userAuthKrb()
     QUuid uuid = QUuid::createUuid();
     QString uuidStr = uuid.toString().mid(1, 36).toLower();
 
-    QString shcmd = "sh -c 'echo X2GODATABEGIN:" + uuidStr + "; whoami; echo X2GODATAEND:" + uuidStr +";'";
+    QString shcmd = " echo X2GODATABEGIN:" + uuidStr + "; whoami; echo X2GODATAEND:" + uuidStr ;
 
 #ifdef Q_OS_WIN
     sshCmd="plink -batch "+user+"@"+host+" -P "+
diff --git a/sshprocess.cpp b/sshprocess.cpp
index f605eb9..451425f 100755
--- a/sshprocess.cpp
+++ b/sshprocess.cpp
@@ -190,7 +190,7 @@ void SshProcess::startNormal(const QString& cmd)
 // #endif
     if(!masterCon->useKerberos())
     {
-        QString shcmd = "sh -c 'echo X2GODATABEGIN:" + uuidStr + "; PATH=/usr/local/bin:/usr/bin:/bin "+cmd+"; echo X2GODATAEND:" + uuidStr +";'";
+        QString shcmd = "sh -c \"echo X2GODATABEGIN:" + uuidStr + "; PATH=/usr/local/bin:/usr/bin:/bin "+cmd+"; echo X2GODATAEND:" + uuidStr +"\";";
         masterCon->addChannelConnection(this, uuidStr, shcmd);
         connect(masterCon,SIGNAL(stdOut(SshProcess*,QByteArray)),this,SLOT(slotStdOut(SshProcess*,QByteArray)));
         connect(masterCon,SIGNAL(channelClosed(SshProcess*,QString)), this,SLOT(slotChannelClosed(SshProcess*,QString)));
@@ -198,7 +198,7 @@ void SshProcess::startNormal(const QString& cmd)
     else
     {
         QString host=masterCon->getHost();
-        QString shcmd = "sh -c 'echo X2GODATABEGIN:" + uuidStr + "; PATH=/usr/local/bin:/usr/bin:/bin "+cmd+"; echo X2GODATAEND:" + uuidStr +";'";
+        QString shcmd = "echo X2GODATABEGIN:" + uuidStr + "; PATH=/usr/local/bin:/usr/bin:/bin "+cmd+"; echo X2GODATAEND:" + uuidStr;
         proc=new QProcess(this);
 #ifdef Q_OS_WIN
         if(masterCon->get_kerberosDelegation())

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


More information about the x2go-commits mailing list