← Back to issue list

Incorrect Exec entry transformation in .desktop file

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1883145
Type
issue
State
open
Author
~alan-griffiths
Labels
—
Created
Updated
Closed
—

Current evaluation

Snapcraft still rewrites only the first desktop Exec token, turning snap run egmde-confined-desktop into egmde-confined-desktop run egmde-confined-desktop; deprecation was discussed but not implemented.

Suggested action: keep open

Reason: The report provides an exact input, generated output, and failing command, and snapcraft/parts/desktop_file.py still unconditionally replaces exec_split[0] while preserving the invalid run argument. A maintainer explicitly said rewriting would be deprecated and warned, but no corresponding removal or safeguard is present in the current code or tests.

Evaluated by: mr-cal-bot

Impact: 48 Quick Win: 17 Complexity: 52 Confidence: 92 Actionability: 74

Issue body

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

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 48
Quick Win: 17
Complexity: 52
Confidence: 92
Actionability: 74
keep open Snapcraft still rewrites only the first desktop Exec token, turning snap run egmde-confined-desktop into egmde-confined-desktop run egmde-confined-desktop; deprecation was discussed but not implemented.
stealth/space-bunny-alpha
Impact: 46
Quick Win: 18
Complexity: 55
Confidence: 93
Actionability: 88
keep open Desktop Exec rewriting turns `snap run egmde-confined-desktop` into an invalid command; acknowledged for deprecation, but the current implementation still rewrites it.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 26
Complexity: 20
Confidence: 85
Actionability: 80
keep open Bug in snapcraft desktop file Exec entry transformation: 'snap run <snap>' is incorrectly rewritten, breaking desktop integration.
qwen/qwen3.8-27b
Impact: 35
Quick Win: 21
Staleness: 95
Complexity: 40
Confidence: 40
Support Request: 10
needs triage Snapcraft incorrectly transforms Exec=snap run <snap> in .desktop files to Exec=<snap> run <snap>, producing a broken command. 6+ years old, no labels, no comments, no maintainer interaction.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 10
close stale Bug report detailing incorrect Exec entry transformation in snapd-generated .desktop files, causing runtime failures. Unlabeled, zero comments, and inactive for over five years.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 80
Support Request: 5
close stale Incorrect Exec entry transformation in .desktop files causes command execution failures. Issue remains untriaged with zero maintainer interaction for over five years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 80
Support Request: 10
needs triage Unassessed bug report detailing incorrect Exec entry transformation in snapd-generated .desktop files, causing execution failures. No maintainer response or labels in over six years.

Update history

Date Change
created

Related work

  • Related To: snapcraft (launchpad)#1658123 (confidence 91%)

    Earlier Exec-rewriting bug produced invalid aliases; fixed by PR #1061 and commit b393badb4, but it did not address commands beginning with snap run.

Related issues

No related issues found above the similarity threshold.