[X2Go-Commits] [x2goclient] 01/01: onmainwindow.cpp: also escape other shell quotes when using Kerberos/GSSApi.

git-admin at x2go.org git-admin at x2go.org
Thu Jun 4 00:35:30 CEST 2015


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

x2go pushed a commit to branch master
in repository x2goclient.

commit d7156ade484ecba1e038dba9ccf613e4478016b9
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Jun 4 00:28:40 2015 +0200

    onmainwindow.cpp: also escape other shell quotes when using Kerberos/GSSApi.
---
 debian/changelog     |    2 ++
 src/onmainwindow.cpp |   22 +++++++++++++++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index efac03b..bfdd3d1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -39,6 +39,8 @@ x2goclient (4.0.4.1-0x2go1) UNRELEASED; urgency=low
       unspecific "sh".
     - onmainwindow.cpp: try to escape shell quotes correctly when using
       Kerberos/GSSApi when running the xmodmap keyboard sync command on OS X.
+    - onmainwindow.cpp: also escape other shell quotes when using
+      Kerberos/GSSApi.
 
  -- X2Go Release Manager <git-admin at x2go.org>  Tue, 26 May 2015 21:42:09 +0200
 
diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp
index e548359..931a598 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -5056,7 +5056,12 @@ void ONMainWindow::slotRetResumeSess ( bool result,
                      resumingSession.sessionId+
                      "/.pulse-client.conf\"";
 
-            sshConnection->executeCommand(scmd);
+            /* Escape quotes - executing commands with Kerberos/GSSApi enabled adds another layer of quoting. */
+            if (sshConnection->useKerberos ()) {
+                scmd.replace ('"', "\\\"");
+            }
+
+            sshConnection->executeCommand (scmd);
 
             bool sysPulse=false;
 #ifdef Q_OS_LINUX
@@ -6401,10 +6406,17 @@ void ONMainWindow::runCommand()
 
 void ONMainWindow::runApplication(QString exec)
 {
-    sshConnection->executeCommand ("PULSE_CLIENTCONFIG=\"${HOME}/.x2go/C-"+
-                                   resumingSession.sessionId+"/.pulse-client.conf\" DISPLAY=:"+
-                                   resumingSession.display+
-                                   " setsid "+exec+" 1> /dev/null 2>/dev/null & exit");
+    QString cmd = "PULSE_CLIENTCONFIG=\"${HOME}/.x2go/C-"
+                + resumingSession.sessionId+"/.pulse-client.conf\" DISPLAY=:"
+                + resumingSession.display
+                + " setsid " + exec + " 1> /dev/null 2>/dev/null & exit";
+
+    /* Escape quotes - executing commands with Kerberos/GSSApi enabled adds another layer of quoting. */
+    if (sshConnection->useKerberos ()) {
+        cmd.replace ('"', "\\\"");
+    }
+
+    sshConnection->executeCommand (cmd);
 }
 
 void ONMainWindow::slotRetRunCommand ( bool result, QString output,

--
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