Do not allow two different apps to have the same autostart-desktop file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
We had a bug in ubuntu-software where the same desktop file was used as an autostart script, this was causing snapd to always launch the desktop file as the wrong application.
This was the wrong snapcraft.yaml file:
- https:/
In fact, as per: https:/
So, snapcraft should use a stronger check to ensure that a desktop-id is not shared by multiple auto-start entries for different apps, otherwise snapd will not be able to launch the correct application.
Snapd could also do some stronger checks, based on the exec file, but that would make its logic more complex.
This is what was happening at snapd level (adding more debug):
tool_linux.go:93: DEBUG: snap (at "/snap/ core/current" ) is older ("2.58.3") than distribution package ("2.58. 3+23.04ubuntu1" ) software- service. desktop software- service. desktop, matching ubuntu- software- service. desktop (snap-store . usr/bin/snap-store) ubuntu- software --gapplication- service snap-store --gapplication- service
autostart.go:261: DEBUG: autostart desktop file ubuntu-
autostart.go:269: DEBUG: snap name: "snap-store"
autostart.go:161: DEBUG: Autostart desktop file is ubuntu-
autostart.go:179: DEBUG: exec line: snap-store.
autostart.go:196: DEBUG: Command to launch is /snap/bin/
While in one hacked version of snapd, where we do not break at the first desktop file and we've more debugging bits:
tool_linux.go:93: DEBUG: snap (at "/snap/ core/current" ) is older ("2.58.3") than distribution package ("2.58. 3+23.04ubuntu1" ) software- service. desktop software- service. desktop, matching ubuntu- software- service. desktop (snap-store . usr/bin/snap-store) software- service. desktop, matching ubuntu- software- service. desktop (ubuntu-software . usr/bin/snap-store) software- service. desktop (ubuntu- software- local-file . usr/bin/snap-store) ubuntu- software --gapplication- service snap-store. ubuntu- software --gapplication- service
autostart.go:261: DEBUG: autostart desktop file ubuntu-
autostart.go:269: DEBUG: snap name: "snap-store"
autostart.go:161: DEBUG: Autostart desktop file is ubuntu-
autostart.go:161: DEBUG: Autostart desktop file is ubuntu-
autostart.go:161: DEBUG: Autostart desktop file is , matching ubuntu-
autostart.go:179: DEBUG: exec line: snap-store.
autostart.go:196: DEBUG: Command to launch is /snap/bin/