[X2Go-Commits] [x2goclient] 01/01: onmainwindow.cpp: try to escape shell quotes correctly when using Kerberos/GSSApi when running the xmodmap keyboard sync command on OS X.

git-admin at x2go.org git-admin at x2go.org
Wed Jun 3 23:51:06 CEST 2015


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

x2go pushed a commit to branch bugfix/osx-kerberos
in repository x2goclient.

commit bb32a8cffdfb60d7da933dcb63eab580222a4392
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Jun 3 23:49:00 2015 +0200

    onmainwindow.cpp: try to escape shell quotes correctly when using Kerberos/GSSApi when running the xmodmap keyboard sync command on OS X.
---
 debian/changelog     |    2 ++
 src/onmainwindow.cpp |   10 +++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index dee4e58..efac03b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -37,6 +37,8 @@ x2goclient (4.0.4.1-0x2go1) UNRELEASED; urgency=low
       quotes.
     - sshprocess.cpp: wrap all remote commands with "bash" instead of the
       unspecific "sh".
+    - onmainwindow.cpp: try to escape shell quotes correctly when using
+      Kerberos/GSSApi when running the xmodmap keyboard sync command on OS X.
 
  -- 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 64448b5..e548359 100644
--- a/src/onmainwindow.cpp
+++ b/src/onmainwindow.cpp
@@ -5509,7 +5509,15 @@ void ONMainWindow::slotSetModMap()
             }
         }
     }
-    sshConnection->executeCommand("export DISPLAY=:"+resumingSession.display+"; echo \""+kbMap+"\" | xmodmap -");
+
+    QString cmd = "export DISPLAY=\":" + resumingSession.display + "\"; echo \"" + kbMap + "\" | xmodmap -";
+
+    /* Escape quotes - executing commands with Kerberos/GSSApi enabled adds another layer of quoting. */
+    if (sshConnection->useKerberos ()) {
+        cmd.replace ('"', "\\\"");
+    }
+
+    sshConnection->executeCommand (cmd);
 }
 #endif
 

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