Lightdm fails to undo quoting for Exec key

Bug #1848849 reported by Syncopated
6
This bug affects 1 person
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://developer.gnome.org/desktop-entry-spec/#exec-variables

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/xsessions/test.desktop:
[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://mirrors.yun-idc.com/ubuntu disco/universe amd64 Packages
        100 /var/lib/dpkg/status

Syncopated (joshchia)
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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.