snapcraft doesn't fail if the command exists in the host but not in the prime directory
Bug #1710254 reported by
Leo Arias
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Triaged
|
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
To post a comment you must log in.
Ouch. Yeah we need to look at the path that being resolved and ensure it's actually in the snap.