View Issue Details

IDProjectCategoryView StatusLast Update
0000267fileGeneralpublic2021-06-30 10:25
Reporterxexaxo Assigned Tochristos  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.40 
Fixed in Version5.41 
Summary0000267: File detects CPIO files as "application/octet-stream"
DescriptionUsing --mime with CPIO files made by bsdtar, seems to detected incorrectly.

In particular:
 file --mime foo.cpio
 foo.cpio: application/octet-stream; charset=binary

On the other hand, when omitting the --mime it is detected properly:
 file foo.cpio
 foo.cpio: ASCII cpio archive (SVR4 with no CRC)

The file foo.cpio was created using the following:
 echo test > test-file
 LANG=C bsdtar --uid 0 --gid 0 --null -cf - --format=newc test-file > foo.cpio
TagsNo tags attached.

Activities

xexaxo

2021-05-31 17:19

reporter   ~0003609

In case it matters, xdg-mime correctly detects the file:
 xdg-mime query filetype foo.cpio
 application/x-cpio

polluks

2021-06-03 21:45

reporter   ~0003610

--- archive.bak 2021-04-26 09:54:42 +0200
+++ archive 2021-06-03 23:43:29 +0200
@@ -169,6 +169,7 @@
 !:mime application/x-cpio # encoding: swapped
 0 string 070707 ASCII cpio archive (pre-SVR4 or odc)
 0 string 070701 ASCII cpio archive (SVR4 with no CRC)
+!:mime application/x-cpio
 0 string 070702 ASCII cpio archive (SVR4 with CRC)
 
 #

xexaxo

2021-06-04 15:10

reporter   ~0003611

Thanks polluks - your suggestion works like a charm.
Now if I can figure out how this fix can get merged into the official tree...

christos

2021-06-30 10:25

manager   ~0003618

Fixed, thanks

Issue History

Date Modified Username Field Change
2021-05-31 17:15 xexaxo New Issue
2021-05-31 17:19 xexaxo Note Added: 0003609
2021-06-03 21:45 polluks Note Added: 0003610
2021-06-04 15:10 xexaxo Note Added: 0003611
2021-06-30 10:24 christos Assigned To => christos
2021-06-30 10:24 christos Status new => assigned
2021-06-30 10:25 christos Status assigned => resolved
2021-06-30 10:25 christos Resolution open => fixed
2021-06-30 10:25 christos Fixed in Version => 5.41
2021-06-30 10:25 christos Note Added: 0003618