snapcraft should warn of invalid name
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapcraft (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
This looks similar to bug #1589613, but I’m not sure whether I should just re-open it, so here’s a new one.
Snapcraft allows building snaps with invalid names, which are then installed but cannot be run because snap-confine complains of an invalid security tag:
$ snapcraft
"grade" property not specified: defaulting to "stable"
Preparing to pull 1foo
Pulling 1foo
Preparing to build 1foo
Building 1foo
Staging 1foo
Priming 1foo
Snapping '1foo' |
Snapped 1foo_1.0_amd64.snap
$ sudo snap install --dangerous 1foo_1.0_amd64.snap
1foo 1.0 installed
$ 1foo
security tag snap.1foo.1foo not allowed
This happens if the name of the snap starts with a number (e.g. "1foo"). The documentation for verify_
Snapcraft should bail out early instead of generating a snap with an invalid name.
Here is a test snapcraft.yaml file for the use case:
$ cat snapcraft.yaml
name: 1foo
version: 1.0
summary: snap with invalid name
description: a snap package with an invalid name
confinement: strict
apps:
1foo:
command: bin/1foo
parts:
1foo:
plugin: dump
source: .
organize:
1foo: bin/