Merge lp://qastaging/~lool/snapcraft/no-separate-toplevel-dir into lp://qastaging/~snappy-dev/snapcraft/core

Proposed by Loïc Minier
Status: Merged
Approved by: Michael Terry
Approved revision: 107
Merged at revision: 109
Proposed branch: lp://qastaging/~lool/snapcraft/no-separate-toplevel-dir
Merge into: lp://qastaging/~snappy-dev/snapcraft/core
Diff against target: 116 lines (+53/-12)
3 files modified
integration-tests/data/simple-tar/snapcraft.yaml (+12/-0)
integration-tests/units/jobs.pxu (+6/-0)
snapcraft/__init__.py (+35/-12)
To merge this branch: bzr merge lp://qastaging/~lool/snapcraft/no-separate-toplevel-dir
Reviewer Review Type Date Requested Status
Michael Terry (community) Approve
Review via email: mp+265754@code.qastaging.launchpad.net

Commit message

Rework tarball unpack to use tarfile. New implementation deals properly with tarballs which ship all files under a common directory, but without an entry for this common directory. Also handles dangerous tarballs with pathes starting with / or ../. Adjust tests accordingly.

NB: this was found while trying to use the upstream tomcat tarball; toplevel parent dir didn't get stripped on unpack.

Description of the change

Rework tarball unpack to use tarfile. New implementation deals properly with tarballs which ship all files under a common directory, but without an entry for this common directory. Also handles dangerous tarballs with pathes starting with / or ../. Adjust tests accordingly.

NB: this was found while trying to use the upstream tomcat tarball; toplevel parent dir didn't get stripped on unpack.

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Thanks! I didn't realize tar didn't handle evil paths for us. :(

And I totally forgot about the tarfile module.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches