[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Issue of using "dpkg" for newer ".deb" files
From:       Ken CJ Chou <kenchou0731 () gmail ! com>
Date:       2019-10-12 17:35:29
Message-ID: CAGLgBv=u7RZWWhc21xjGLTv-yubfQGpgd37vJix=wfgYm_2myA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


It works! Thank you very much.

Ken

Denys Vlasenko <vda.linux@googlemail.com> =E6=96=BC 2019=E5=B9=B410=E6=9C=
=8811=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=888:14=E5=AF=AB=E9=81=93=
=EF=BC=9A

> On Sun, Sep 29, 2019 at 6:38 AM Ken CJ Chou <kenchou0731@gmail.com> wrote=
:
> >
> >
> > Hello,
> >
> > I'm using the latest version of busybox (1.31.0).
> > I found an issue when using "dpkg" and "dpkg-deb" in busybox.
> > When I performed some task to get the control info of a ".deb" file.
> > The output showed a "dpkg-deb: corrupted data" message.
> >
> > e.g.
> > ```
> > # dpkg-deb -f <some_deb_file>
> > Package: <some_package>
> > ...
> > dpkg-deb: corrupted data
> > ```
> >
> > I looked into the source code.
> > In file "archival/libarchive/decompress_unxz.c" line 97, here busybox
> tried to decompress another xz stream when it found that the input stream
> isn't ended.
> >
> > So the issue happens on newer Debian package files.
> > Newer Debian package files format is an "ar" archive of 3 files
> including "debian-binary", "control.tar.xz", "data.tar.xz" in orders.
> > When performing tasks on the Debian package file, the archive handler
> open the ".deb" file as the input stream.
> > When busybox complete reading the section of "control.tar.xz", it
> automatically tried to decompress another xz stream because there is stil=
l
> the section of "data.tar.xz" in the input stream.
> > In this situation, busybox will read the label of "ar" archive for
> "data.tar.xz" section. Then it fails at checking xz's header magic. And
> finally a "corrupted data" error message is printed.
>
> Good analysis.
>
> I added a work-around, please try current git.
>

[Attachment #5 (text/html)]

<div dir="ltr">It works! Thank you very \
much.<br><div><br></div><div>Ken</div></div><br><div class="gmail_quote"><div \
dir="ltr" class="gmail_attr">Denys Vlasenko &lt;<a \
href="mailto:vda.linux@googlemail.com">vda.linux@googlemail.com</a>&gt; 於 \
2019年10月11日 週五 下午8:14寫道:<br></div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">On Sun, Sep 29, 2019 at 6:38 AM Ken CJ Chou &lt;<a \
href="mailto:kenchou0731@gmail.com" target="_blank">kenchou0731@gmail.com</a>&gt; \
wrote:<br> &gt;<br>
&gt;<br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m using the latest version of busybox (1.31.0).<br>
&gt; I found an issue when using &quot;dpkg&quot; and &quot;dpkg-deb&quot; in \
busybox.<br> &gt; When I performed some task to get the control info of a \
&quot;.deb&quot; file.<br> &gt; The output showed a &quot;dpkg-deb: corrupted \
data&quot; message.<br> &gt;<br>
&gt; e.g.<br>
&gt; ```<br>
&gt; # dpkg-deb -f &lt;some_deb_file&gt;<br>
&gt; Package: &lt;some_package&gt;<br>
&gt; ...<br>
&gt; dpkg-deb: corrupted data<br>
&gt; ```<br>
&gt;<br>
&gt; I looked into the source code.<br>
&gt; In file &quot;archival/libarchive/decompress_unxz.c&quot; line 97, here busybox \
tried to decompress another xz stream when it found that the input stream isn&#39;t \
ended.<br> &gt;<br>
&gt; So the issue happens on newer Debian package files.<br>
&gt; Newer Debian package files format is an &quot;ar&quot; archive of 3 files \
including &quot;debian-binary&quot;, &quot;control.tar.xz&quot;, \
&quot;data.tar.xz&quot; in orders.<br> &gt; When performing tasks on the Debian \
package file, the archive handler open the &quot;.deb&quot; file as the input \
stream.<br> &gt; When busybox complete reading the section of \
&quot;control.tar.xz&quot;, it automatically tried to decompress another xz stream \
because there is still the section of &quot;data.tar.xz&quot; in the input \
stream.<br> &gt; In this situation, busybox will read the label of &quot;ar&quot; \
archive for &quot;data.tar.xz&quot; section. Then it fails at checking xz&#39;s \
header magic. And finally a &quot;corrupted data&quot; error message is printed.<br> \
<br> Good analysis.<br>
<br>
I added a work-around, please try current git.<br>
</blockquote></div>



_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic