Incorrect Exec entry transformation in .desktop file

Bug #1883145 reported by Alan Griffiths
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Triaged
Medium
Chris Patterson

Bug Description

Changes made to the Exec entry for a .desktop file can result in an invalid entry:

For example, with this input:

[Desktop Entry]
Name=egmde (confined)
Comment=The example Mir server
Exec=snap run egmde-confined-desktop
Type=Application

The result is:

$ cat /snap/egmde-confined-desktop/current/meta/gui/egmde-confined-desktop.desktop

[Desktop Entry]
Name=egmde (confined)
Comment=The example Mir server
Exec=egmde-confined-desktop run egmde-confined-desktop
Type=Application

$ cat /var/lib/snapd/desktop/applications/egmde-confined-desktop_egmde-confined-desktop.desktop
[Desktop Entry]
X-SnapInstanceName=egmde-confined-desktop
Name=egmde (confined)
Comment=The example Mir server
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/egmde-confined-desktop_egmde-confined-desktop.desktop /snap/bin/egmde-confined-desktop run egmde-confined-desktop
Type=Application

But trying to run `env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/egmde-confined-desktop_egmde-confined-desktop.desktop /snap/bin/egmde-confined-desktop run egmde-confined-desktop` will fail:

$ env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/egmde-confined-desktop_egmde-confined-desktop.desktop /snap/bin/egmde-confined-desktop run egmde-confined-desktop
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
Unknown command line options: run egmde-confined-desktop

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

- We will deprecate rewriting
- Warn when rewriting happens
- The deprecation page will show how to have full control over this
  SNAPCRAFT_PART_INSTALL/snap/desktop/<snap-name>.<app-name>.desktop

Even with all this said, snapd has strict rules on what a valid exec line is.

Changed in snapcraft:
assignee: nobody → Chris Patterson (cjp256)
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → Medium
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.