Skip to content

Debian extract is suboptimal #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rossburton opened this issue Jan 21, 2019 · 0 comments
Closed

Debian extract is suboptimal #2

rossburton opened this issue Jan 21, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@rossburton
Copy link
Contributor

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
WARNING:cve_bin_tool.TempDirExtractorContext:Failure extracting '/data/poky-tmp/master/deploy/ipk/corei7-64/linux-libc-headers-dbg_4.18-r0_corei7-64.ipk'

So the problem here is that data.tar could be compressed with xz:

$ ar x sln_2.28-r0_corei7-64.ipk
$ ls
control.tar.gz  data.tar.xz  debian-binary  sln_2.28-r0_corei7-64.ipk

However, the data is always called data.tar.* so there's no need to look into control.tar.gz at all.

rossburton added a commit to rossburton/cve-bin-tool that referenced this issue Jan 21, 2019
A Debian package is an 'ar' archive with two files:
- control.tar.gz (metadata)
- data.tar.* (content)

Because cve-bin-tool only cares about the content it can skip iterating the
unpacked archives and go straight to data.tar. This file may be compressed with
a number of compressors so don't hardcode gzip, use glob to find the filename
and let tar determine how to unpack it.

Fixes intel#2

Signed-off-by: Ross Burton <ross.burton@intel.com>
@johnandersen777 johnandersen777 added the bug Something isn't working label Feb 5, 2019
johnandersen777 pushed a commit that referenced this issue Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants