[pkg-x2go-devel] Bug#696529: X2Go Plugin segfaults if the session config (via html) has lines starting with whitespaces

Mike Gabriel mike.gabriel at das-netzwerkteam.de
Sat Dec 22 13:13:58 UTC 2012


Package: x2goplugin
Version: 3.99.2.1-1
Severity: important

The X2Go Plugin gets its session configuration via a html file:

"""
   <body onload="checkPlugin()">
     <div id="x2goplugin">
     <object
         src="location"
         type="application/x2go"
         name="x2goplugin"
         palette="background"
         height="100%"
         hspace="0"
         vspace="0"
         width="100%"
         x2goconfig="
session=X2Go-Demo-Session
server=localhost
user=
sshport=22
command=XFCE
rootless=false
sound=true
exportfs=true
speed=adsl
compression=16m-jpeg
quality=9
dpi=120
kbdlayout=
kbdtype=auto
showtoolbar=true
showstatusbar=true
usekbd=true
soundsystem=pulse
soundtunnel=true
defsndport=true
print=true
rootless=false
published=false
applications=WWWBROWSER, MAILCLIENT, OFFICE, TERMINAL
">
     </object>

     </div>
   </body>
"""

The parsing of session options fails if a session profile option is  
preceeded by whitespaces.

Like:

     <object
         src="location"
         type="application/x2go"
         name="x2goplugin"
         palette="background"
         height="100%"
         hspace="0"
         vspace="0"
         width="100%"
         x2goconfig="
             session=X2Go-Demo-Session
             server=localhost
             user=
             sshport=22
             command=XFCE
             rootless=false
             sound=true
             exportfs=true
             speed=adsl
             compression=16m-jpeg
             quality=9
             dpi=120
             kbdlayout=
             kbdtype=auto
             showtoolbar=true
             showstatusbar=true
             usekbd=true
             soundsystem=pulse
             soundtunnel=true
             defsndport=true
             print=true
             rootless=false
             published=false
             applications=WWWBROWSER, MAILCLIENT, OFFICE, TERMINAL">
     </object>

The patch below adds the requested whitespace tolerance:

+--- a/onmainwindow.cpp
++++ b/onmainwindow.cpp
@@ -9364,6 +9369,11 @@
      for ( int i=0;i<lines.count();++i )
      {
          QString line = lines[i];
+
+        // strip left/right whitespaces, important for plugin  
settings via x2goconfig
+        line.remove(QRegExp("^\\s+"));
+        line.remove(QRegExp("\\s+$"));
+
          if ( ( line=="-----BEGIN DSA PRIVATE KEY-----" ) ||
                  ( line=="-----BEGIN RSA PRIVATE KEY-----" ) )
          {

Greets,
Mike


-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabriel at das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digitale PGP-Unterschrift
URL: <http://lists.alioth.debian.org/pipermail/pkg-x2go-devel/attachments/20121222/97b5d303/attachment.pgp>


More information about the Pkg-x2go-devel mailing list