xdmcp script don't work with a remote server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
LTSP5 |
Fix Committed
|
Low
|
Unassigned | ||
Ubuntu |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
PROBLEM:
I tried use xdmcp (startx) script in LTSP to connect in a remote X server and it not work. Although using the package for Ubuntu, I checked that the same occurs in the packet with the ltsp 5.4.5 source code, independent of the distribution.
lts.conf
[00:11:22:AA:BB:CC]
SCREEN_07=xdmcp
XDM_SERVER=x.x.x.x
When thinclient boot, the XDM_SERVER value is ignored.
I found a bug in screen_session script, line 78 (or was it in bash?). It calls a script with $args variable as argument between double quotes:
78: "$script_path" "$args"
In xdmcp script lines 19-23, exists a condition, based in number of arguments:
19: if [ $# -lt 1 ]; then
20: X_ARGS="$X_ARGS -query ${XDM_SERVER}"
21: else
22: X_ARGS="$X_ARGS $*"
23: fi
Even without arguments, in this case, $args empty, bash/sh return 1 as total arguments in $# variable, because of the double quotes used in screen_session script.
So the condition will always be FALSE, ignoring XDM_SERVER value.
SOLUTION:
change session script line 78 to:
78: "$script_path" $args
or
78: eval "$script_path" "$args"
Regards,
Andrey de Oliveira
LPIC-1
The same problem appears whith ssh session script (bug #1020113). It is (as you correctly found out), caused by wrong quoting of arguments in line 78 of /opt/ltsp/ i386/usr/ share/ltsp/ screen_ session.
Bug report #1020113 contains a patch that seems to fix the problem (I confirm it works for the ssh session script), but it has not (yet) made it into the release.
Marking as duplicate.