Zip packages are not extracted properly with snapcraft 2.35
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Critical
|
Kyle Fazzari |
Bug Description
We have a snapcraft build that downloads various zip packages and does something with the content. The issue can also be reproduced with a snapcraft.yaml file with the following content:
*******
name: test
version: '123'
grade: stable
confinement: devmode
summary: fdsfsdfsfd
description: fdsfdsfsdfd
parts:
fonts:
plugin: dump
source: https:/
source-type: zip
organize:
'TTF': usr/share/
stage:
- usr/share/
*******
After upgrading from snapcraft 2.34 to 2.35 on Ubuntu 16.04 LTS, the unzipping fails:
Pulling fonts
Downloading 'clearsans-
Traceback (most recent call last):
File "/usr/bin/
load_
...
File "/usr/lib/
extracted_file = f.extract(
File "/usr/lib/
return self._extract_
File "/usr/lib/
open(
PermissionError: [Errno 13] Permission denied: '/home/
It somehow manages to create a completely empty directory (named EOT in this case) which you cannot even run ls on.
By commenting out line 59 in /usr/lib/
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
This was indeed a feature added in v2.35 trying to work around a zip bug in Python. However, the fix did not take into account the possibility of zip files being created on non-unix systems, as the bug actually mentions.