Lightdm fails to undo quoting for Exec key
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Light Display Manager |
New
|
Undecided
|
Unassigned |
Bug Description
According to spec/documentation, "implementations must undo quoting before expanding field codes and before passing the argument to the executable program."
https:/
lightdm fails to do so and passes the double-quote characters to the executable program.
Consider the following files:
myecho:
#!/bin/bash
echo "$1" > /tmp/cmd
/usr/share/
[Desktop Entry]
Name=Test
Comment=This is a test session
Type=Application
Exec=myecho "argument"
myecho is to be located somewhere in the PATH.
When trying to start a desktop session defined by test.desktop, as a result of running myecho, the first command-line argument from the Exec is written to /tmp/cmd.
Here is where lightdm is wrong: Starting the 'test' session under lightdm causes '"argument"' (without the surrounding single quotes) to be written to /tmp/cmd. The correct string should be 'argument' (without the surrounding single quotes). If the double-quotes are removed from the Exec line, lightdm behaves normally and 'argument' is written.
A practical consequence of this bug is that users can't use "bash -c" to run multiple commands when special characters (including spaces) are needed in the argument after "-c". It seems that the user must resort to a wrapper script because of this bug.
$ lsb_release -rd
Description: Ubuntu 19.04
Release: 19.04
$ apt-cache policy lightdm
lightdm:
Installed: 1.28.0-0ubuntu1
Candidate: 1.28.0-0ubuntu1
Version table:
*** 1.28.0-0ubuntu1 500
500 http://
100 /var/lib/
affects: | unity-settings-daemon (Ubuntu) → lightdm (Ubuntu) |
affects: | lightdm (Ubuntu) → lightdm |
Changed in lightdm: | |
assignee: | nobody → LightDM Development Team (lightdm-team) |
assignee: | LightDM Development Team (lightdm-team) → nobody |