commit 6c607f8df4ee6f7a31e25ed07d4fe43a11c32804
Author: Frank Ch. Eigler <f...@redhat.com>
Date:   Sun Feb 14 16:02:05 2021 -0500

    PR27413: use bsdtar to unpack deb-related formats
    
    dpkg-deb has been reported to be fragile when running under
    debuginfod, whereas bsdtar (libarchive) is happy with all these
    flavors of files.  Switch to a bsdtar based pipeline, now
    equipped with an escaped glob pattern that adapts to a variety
    of interior data.tar* compression formats.
    
    No testsuite impact.  .ipk format tested with some random openwrt and
    kino-extension binaries found on the net.  Some of these are built
    with out buildid, and hardly any with debuginfo, but whatever, bsdtar
    and elfutils extract whatever info is there.
    
    Signed-off-by: Frank Ch. Eigler <f...@redhat.com>

diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 8de885223de3..a66ded383a9f 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,8 @@
+2021-02-14  Frank Ch. Eigler <f...@redhat.com>
+
+       * debuginfod.cxx (main -U): Use bsdtar unconditionally.  Also map
+       the debian-compatible .ipk (openembedded distro family) to same.
+
 2021-02-04  Frank Ch. Eigler <f...@redhat.com>
 
        PR27092 low-memory handling
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index b34eacc29dc9..6fdaf60e6632 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -480,16 +480,9 @@ parse_opt (int key, char *arg,
       scan_archives[".rpm"]="cat"; // libarchive groks rpm natively
       break;
     case 'U':
-      if (access("/usr/bin/dpkg-deb", X_OK) == 0)
-        {
-          scan_archives[".deb"]="dpkg-deb --fsys-tarfile";
-          scan_archives[".ddeb"]="dpkg-deb --fsys-tarfile";
-        }
-      else
-        {
-          scan_archives[".deb"]="(bsdtar -O -x -f - data.tar.xz)<";
-          scan_archives[".ddeb"]="(bsdtar -O -x -f - data.tar.xz)<";
-        }
+      scan_archives[".deb"]="(bsdtar -O -x -f - data.tar\\*)<";
+      scan_archives[".ddeb"]="(bsdtar -O -x -f - data.tar\\*)<";
+      scan_archives[".ipk"]="(bsdtar -O -x -f - data.tar\\*)<";
       // .udeb too?
       break;
     case 'Z':

Reply via email to