xrdp fails if Xsession not /bin/sh script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
xrdp (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In Ubuntu 14.04; package xrdp, version 0.6.0-1:
If /etc/X11/Xsession is not a /bin/sh script, xrdp sessions may not start.
The trouble is that /etc/xrdp/
#!/bin/sh
and executes Xsession with
. /etc/X11/Xsession
If Xsession contains anything that is not a valid /bin/sh command, an error may result; depending on the error, Xsession may misbehave (leaving an improperly-set-up session) or just exit (abruptly terminating the session).
Live example: we have a heavily-localised Xsession file. It is a bash script; its first line is
#!/bin/bash
It contains some commands that are valid bash but not valid /bin/sh (== dash). They are sufficiently invalid that Xsession exits. Hence no one can make a useful session via RDP.
The same Xsession file has worked for years with kdm, so it is not a general assumption that Xsession is a /bin/sh script; in fact I think the general X11 rule is that it's just some sort of executable.
A simple fix is to replace the offending line in startwm.sh with
exec /etc/X11/Xsession
(Or just /etc/X11/Xsession without the exec, but it's the last line of the file, so there's no reason to keep the extra process hanging around.) This lets the kernel decide what to do about Xsession, #!/bin/bash tells it what to do, and everything works.
Thanks!
Changed in xrdp (Ubuntu): | |
status: | Confirmed → Fix Released |
Some additional clues:
1. The offending file in the source package, as fetched by apt-get source xrdp, is 6.0/debian/ startwm. sh
xrdp-0.
2. I have ordinary-user access to an Ubuntu 16.04 system. apt-get source xrdp there confirms that the corresponding file 6.1/debian/ startwm. sh
xrdp-0.
is the same. So the same bug exists in Ubuntu 16.04, in xrdp 0.6.1.
3. In both cases it looks like the bug is imported from Debian.