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

Bug #1710254 reported by Leo Arias on 2017-08-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
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

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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers