Subject: xinamera extension is broken after update

From: Fernando Pedemonte <[email-masked]>
Date: Thu, 12 Mar 2015 18:42:07 -0300 (ART)

Hi all,

I was having this problem also, and after some debugging I was able to trace the problem to a function in the file onmainwindow.cpp at the x2goclient package.

Enabling the debug on the client I saw at the step of creating the xinerama.conf file inside $HOME/.x2go/xxxxxx/ directory the following:

x2go-DEBUG-../sshmasterconnection.cpp:1469> executing remote: "sh -c 'echo X2GODATABEGIN:38317d7e-972d-417f-9745-ef9cb09d7e35; PATH=/usr/local/bin:/usr/bin:/bin export DISPLAY=:50;printf '1600 0 1600 900\\n0 0 1600 900' >  $HOME/.x2go/C-fpedemonte-50-1426195616_stDXFCE_dp24/xinerama.conf; echo X2GODATAEND:38317d7e-972d-417f-9745-ef9cb09d7e35;'"

As you can see, the "\n" is not escaped correctly. What I did was to modify the following line of code inside onmainwindow.cpp line 10212

        QString cmd="export DISPLAY=:"+resumingSession.display+";printf '"+screens.join("\\\\n")+"' >  $HOME/.x2go/C-"+
                    resumingSession.sessionId+"/xinerama.conf";

To:

        QString cmd="export DISPLAY=:"+resumingSession.display+";printf \""+screens.join("\\n")+"\" >  $HOME/.x2go/C-"+
                    resumingSession.sessionId+"/xinerama.conf";

After this modification, xinerama is working again.
Take note that I also replaced the single quote by double quote and escaped them. Without this modification the printf command was failing to create the xinerama.conf file.

Thanks for this excelent piece of software

Best Regards

Fernando D. Pedemonte
Seguridad Informática
SINTyS
Sistema de Identificación Nacional Tributario y Social
Consejo Nacional de Coordinación de Políticas Sociales
Presidencia de la Nación
Julio A. Roca 782- Piso 5
Ciudad Autónoma de Bs. As.
Tel: (54 11) 43708778 int.8788
[email-masked]

----------- NOTA DE RESPONSABILIDAD: -----------------------------------
Este mensaje proviene de Internet, tome los recaudos necesarios en su
manejo.
El contenido del presente mensaje y sus adjuntos es privado,
estrictamente confidencial y exclusivo para su destinatario, pudiendo
contener información protegida por normas legales y de secreto
profesional.
Bajo ninguna circunstancia su contenido puede ser transmitido o revelado
a terceros ni divulgado en forma alguna. En consecuencia de haberlo
recibido por error, solicitamos contactar al remitente y eliminarlo de
su sistema.
------------------------------------------------------------------------