View Issue Details

IDProjectCategoryView StatusLast Update
0000077fileGeneralpublic2021-02-01 17:33
Reporteryarikoptic Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status feedbackResolutionopen 
Product Version5.35 
Summary0000077: -k, --keep-going does not list other hits - the other one might come out empty
DescriptionDetected while trying to workaround recently added detection of .json as application/json and not as text/plain. I thought that I would obtain both new application/json and text/plain if I use --keep-going . But the 2nd entry comes out to be blank.

As you can see below it is not happening for some other files, and is not unique to json
Steps To Reproduce/tmp > file --version
file-5.35
magic file from /etc/magic:/usr/share/misc/magic

/tmp > echo '{"a": 1}' >| file.json

/tmp > file --mime-type file.json
file.json: application/json

/tmp > file --mime-type -k file.json
file.json: application/json\012- \012-

/tmp > file --mime-type -k /usr/bin/* | head
/usr/bin/[: application/x-pie-executable\012- application/octet-stream
/usr/bin/0alias: application/x-pie-executable\012- application/octet-stream
/usr/bin/0desktop: application/x-pie-executable\012- application/octet-stream
/usr/bin/0install: application/x-pie-executable\012- application/octet-stream
/usr/bin/0launch: application/x-pie-executable\012- application/octet-stream
/usr/bin/0store: application/x-pie-executable\012- application/octet-stream
/usr/bin/0store-secure-add: application/x-pie-executable\012- application/octet-stream
/usr/bin/2to3: text/x-python\012-
/usr/bin/2to3-2.7: text/x-python\012-
/usr/bin/2to3-3.4: text/x-python\012-


/tmp > file --mime-type -k /usr/bin/* > /tmp/usr-bin-mime-types
/tmp > grep '\012- .*\012' /tmp/usr-bin-mime-types | head
/usr/bin/ack: text/x-perl\012- text/x-c\012-
/usr/bin/aclocal-1.16: text/x-perl\012- \012-
/usr/bin/afmtodit: text/x-perl\012- \012-
/usr/bin/apt-file: text/x-perl\012- \012-
/usr/bin/apt-rdepends: text/x-perl\012- \012-
/usr/bin/apxs: text/x-perl\012- \012-
/usr/bin/aspell-import: text/x-perl\012- \012-
/usr/bin/autoheader: text/x-perl\012- \012-
/usr/bin/autom4te: text/x-perl\012- \012-
/usr/bin/automake-1.16: text/x-perl\012- \012-
TagsNo tags attached.

Activities

christos

2019-05-06 21:24

manager   ~0003243

Fixed on HEAD.

sr-verde

2021-02-01 08:50

reporter   ~0003531

Can confirm that issue for version 5.39. Any progress here?

$ file -v
file-5.39
magic file from /usr/share/file/misc/magic
seccomp support included

$ file -k --mime-type /tmp/some.json
/tmp/some.json: application/json\012-

$ file -k --mime-type /tmp/some.csv
/tmp/some.csv: application/csv\012-

christos

2021-02-01 17:33

manager   ~0003532

I committed a change to HEAD. Please try again.

Issue History

Date Modified Username Field Change
2019-04-29 13:35 yarikoptic New Issue
2019-05-06 21:24 christos Assigned To => christos
2019-05-06 21:24 christos Status new => assigned
2019-05-06 21:24 christos Status assigned => feedback
2019-05-06 21:24 christos Note Added: 0003243
2021-02-01 08:50 sr-verde Note Added: 0003531
2021-02-01 17:33 christos Note Added: 0003532