snapcraft doesn't fail if the command exists in the host but not in the prime directory

Bug #1710254 reported by Leo Arias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Medium
Unassigned

Bug Description

During the prime step, snapcraft generates the command wrapper. If the command specified in the apps section of the snapcraft.yaml doesn't exist, snapcraft must fail.

The problem here is that snapcraft is not only searching for the command inside the snap. If a command with the same name is installed in the host, snapcraft will not fail.

To reproduce, use this snapcraft.yaml:

name: dummy
version: dummy
summary: dummy
description: dummy

apps:
  test:
    command: hello

parts:
  dummy:
    plugin: nil

Run:
$ sudo snap install hello
$ snapcraft
--> snapcraft doesn't fail, but it should
$ sudo snap remove hello
$ snapcraft
--> snapcraft fails

Revision history for this message
Kyle Fazzari (kyrofa) wrote :

Ouch. Yeah we need to look at the path that being resolved and ensure it's actually in the snap.

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Since base core20

Changed in snapcraft:
status: Triaged → Fix Released
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.