snapcraft should check file creation permissions and warn/error out instead of generating a non-functional snap

Bug #1871109 reported by Olivier Tilloy
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Expired
Undecided
Unassigned

Bug Description

This probably qualifies as a corner case, but I came across this and I thought snapcraft could do a better job of preventing uninstallable snaps. I was handed over a snap (created with snapcraft) for testing, and it wouldn't install:

$ sudo snap install --dangerous foobar.snap
error: cannot install snap file: snap is unusable due to bad permissions; contact developer

$ journalctl -u snapd
Apr 03 14:09:28 snapd[162506]: container.go:204: in snap "foobar": "meta" should be world-readable and executable, and isn't: drwxr-x---
Apr 03 14:09:28 snapd[162506]: container.go:204: in snap "foobar": "meta/gui" should be world-readable and executable, and isn't: drwxr-x---
Apr 03 14:09:28 snapd[162506]: container.go:228: in snap "foobar": "meta/gui/foobar.desktop" should be world-readable, and isn't: -rw-r-----
Apr 03 14:09:28 snapd[162506]: container.go:228: in snap "foobar": "meta/snap.yaml" should be world-readable, and isn't: -rw-r-----

My guess is that the default file creation mask on the machine where the snap was built was 640 (and 750 for directories). The snap was successfully built, but it cannot be installed.
My suggestion is to have snapcraft either issue an explicit warning, or better yet error out when this happens, to prevent building a snap that cannot be installed.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

We don't do much helping with environment sanity when using --destructive-mode, if that has been the case, the this is mostly a won't fix (except for figuring out why snap --check-skeleton did not run, which would have left you with a similar error message).

If this was not done with --destructive-mode, then we need to figure out what went wrong here.

Changed in snapcraft:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Snapcraft because there has been no activity for 60 days.]

Changed in snapcraft:
status: Incomplete → Expired
Revision history for this message
Adams Jensen (adamsjensen) wrote :

yes i have some issue in the --destructive-mode

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.