resquashfs test fails if snap has symlinks
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
click-reviewers-tools (Ubuntu) |
Invalid
|
High
|
Unassigned | ||
squashfs-tools (Ubuntu) |
Fix Released
|
High
|
Tyler Hicks | ||
Trusty |
Fix Released
|
High
|
Tyler Hicks | ||
Xenial |
Fix Released
|
High
|
Tyler Hicks | ||
Zesty |
Fix Released
|
High
|
Tyler Hicks | ||
Artful |
Fix Released
|
High
|
Tyler Hicks | ||
Bionic |
Fix Released
|
High
|
Tyler Hicks |
Bug Description
[Impact]
* The unsquashfs utility does not preserve atime and mtime timestamps
of symlink inodes when unpacking squashfs images.
* This makes it impossible to use a combination of unsquashfs and
mksquashfs to sanity check snaps uploaded to the snap store since
the resulting snap will not match the original snap due to symlink
times being set to the current time when unsquashfs was executed.
[Test Case]
* Extract the test image:
$ unsquashfs -d lp1555305 lp1555305.squashfs
* Check the timestamp of the "link" file
$ ls -al lp1555305/link
* Incorrect output (timestamp will be current time):
lrwxrwxrwx 1 tyhicks tyhicks 4 Dec 11 22:05 link -> file
* Expected output:
lrwxrwxrwx 1 tyhicks tyhicks 4 Aug 25 1991 /tmp/lp1555305/link -> file
[Regression Potential]
* The regression potential is small as long as there is no software
out there that depends on the behavior of setting symlink timestamps
to the current time. I highly doubt that there is anything out there
that relies on that behavior but there's always a chance.
[Original Descipription]
Create the files:
$ mkdir test
$ cd test
$ touch foo
$ ln -s foo bar
$ mkdir meta
$ cat >meta/snap.yaml <<EOM
name: test
version: 1.0
architectures: [all]
EOM
Create the initial snap
$ cd ..
$ snapcraft snap ./test
...
Snapped test_1.0_all.snap
Unsquash the snap:
$ unsquashfs -d unsquashed test_1.0_all.snap
Parallel unsquashfs: Using 4 processors
3 inodes (2 blocks) to write
[======
created 2 files
created 2 directories
created 1 symlinks
created 0 devices
created 0 fifos
Resquash the snap (the sleep is to make sure the time changes on the symlink):
$ unsquashfs -fstime ./test_1.0_all.snap
1457551603
$ mksquashfs ./unsquashed ./test_
...
Compare:
$ sha512sum test_1.0_all.snap
40a154305037835
$ sha512sum test_1.
d8b9626337b8f09
Removing the symlink makes the check work.
Changed in click-reviewers-tools (Ubuntu): | |
importance: | Undecided → High |
description: | updated |
Changed in click-reviewers-tools (Ubuntu): | |
status: | New → Confirmed |
description: | updated |
Fix submitted to the upstream squashfs project:
https:/ /sourceforge. net/p/squashfs/ mailman/ message/ 36140758/