Bug 13036 - busybox ar unable to uncompress archives produced with -D deterministic-archives options from binutils ar
Summary: busybox ar unable to uncompress archives produced with -D deterministic-archi...
Status: NEW
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.33.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-24 22:22 UTC by Khem Raj
Modified: 2020-06-24 22:22 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Khem Raj 2020-06-24 22:22:04 UTC
Here is test case

$ touch test
$ ar -crfD xx
$ ./busybox_unstripped ar -x ./xx
ar: unrecognized file type


It works ok if the archive is produced using ar -crfU

It seems that the file modes change from 100644 to 0644 in archive header
which confuses busybox ar where its checking 

libarchive/data_extract_all.c

    /* Create the filesystem entry */
      switch (file_header->mode & S_IFMT) {
      case S_IFREG: {
...


and fails this check and reports the above mentioned error.