Bug#863488: file: upgrade broke file magic

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug#863488: file: upgrade broke file magic

Ben Hildred-3
Package: file
Version: 1:5.30-1
Severity: important

A recent upgrade has rendered file just about usless as it is only able to
identify text in the most limited sense.

for example:
$ file /usr/bin/file
/etc/magic, 4: Warning: using regular magic file `/usr/share/misc/magic'
/usr/bin/file: data

or:
$ file /usr/share/doc/file/*
/etc/magic, 4: Warning: using regular magic file `/usr/share/misc/magic'
/usr/share/doc/file/changelog.Debian.gz: data
/usr/share/doc/file/changelog.gz:        data
/usr/share/doc/file/copyright:           ASCII text
/usr/share/doc/file/README.Debian:       ASCII text
/usr/share/doc/file/README.gz:           data

I was expecting something a little more detailed like this from another
machine:
$ file /usr/bin/file /usr/share/doc/file/*
/usr/bin/file:                           ELF 32-bit LSB executable, Intel
80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2,
for GNU/Linux 2.6.32, BuildID [sha1]=b71c29fa59ca57fa80408b99e5b82c2118bd358d,
stripped
/usr/share/doc/file/changelog.Debian.gz: gzip compressed data, max compression,
from Unix
/usr/share/doc/file/changelog.gz:        gzip compressed data, max compression,
from Unix
/usr/share/doc/file/copyright:           ASCII text
/usr/share/doc/file/README.Debian:       ASCII text
/usr/share/doc/file/README.gz:           gzip compressed data, max compression,
from Unix



-- System Information:
Debian Release: 9.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: i386
 (i686)

Kernel: Linux 4.9.0-1-rt-686-pae (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages file depends on:
ii  libc6      2.24-10
ii  libmagic1  1:5.30-1
ii  zlib1g     1:1.2.8.dfsg-5

file recommends no packages.

file suggests no packages.

Reply | Threaded
Open this post in threaded view
|

Bug#863488: file: upgrade broke file magic

Christoph Biedl-7
tags 863488 moreinfo unreproducible
thanks

Ben Hildred wrote...

> A recent upgrade has rendered file just about usless as it is only able to
> identify text in the most limited sense.

Works for me:

> for example:
> $ file /usr/bin/file
> /etc/magic, 4: Warning: using regular magic file `/usr/share/misc/magic'
> /usr/bin/file: data

/usr/bin/file: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=2f833ab1ff58c9e0ae5801481a0dff1da286f30b, stripped

(see the release notes why it's not "executable" any longer)

> or:
> $ file /usr/share/doc/file/*
> /etc/magic, 4: Warning: using regular magic file `/usr/share/misc/magic'
> /usr/share/doc/file/changelog.Debian.gz: data
> /usr/share/doc/file/changelog.gz:        data
> /usr/share/doc/file/copyright:           ASCII text
> /usr/share/doc/file/README.Debian:       ASCII text
> /usr/share/doc/file/README.gz:           data

Results in the expected output.

What is in /usr/share/misc/magic, and where did the file(s) come
from?

    Christoph

signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Bug#863488: file: upgrade broke file magic

Ben Hildred-3


On Sat, May 27, 2017 at 1:25 PM, Christoph Biedl <[hidden email]> wrote:
tags 863488 moreinfo unreproducible
thanks

Ben Hildred wrote...

> A recent upgrade has rendered file just about usless as it is only able to
> identify text in the most limited sense.

Works for me:

> for example:
> $ file /usr/bin/file
> /etc/magic, 4: Warning: using regular magic file `/usr/share/misc/magic'
> /usr/bin/file: data

/usr/bin/file: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=2f833ab1ff58c9e0ae5801481a0dff1da286f30b, stripped

that's more like it.
 
(see the release notes why it's not "executable" any longer)

It hasn't been an issue.
 
> or:
> $ file /usr/share/doc/file/*
> /etc/magic, 4: Warning: using regular magic file `/usr/share/misc/magic'
> /usr/share/doc/file/changelog.Debian.gz: data
> /usr/share/doc/file/changelog.gz:        data
> /usr/share/doc/file/copyright:           ASCII text
> /usr/share/doc/file/README.Debian:       ASCII text
> /usr/share/doc/file/README.gz:           data

Results in the expected output.

What is in /usr/share/misc/magic, and where did the file(s) come
from?

it is a symbolic link to '../file/magic' which is/usr/share/file/magic an empty directory. There is also  /usr/share/file/magic.mgc which is a symbolic link pointing to ../../lib/file/magic.mgc. If I create a symbolic link from /usr/share/misc/magic.mgc to /usr/lib/file/magic.mgc it starts working again. 
 
    Christoph



--
--
Ben Hildred
Automation Support Services
Reply | Threaded
Open this post in threaded view
|

Bug#863488: file: upgrade broke file magic

Christoph Biedl-7
Ben Hildred wrote...

> There is also  /usr/share/file/magic.mgc which is a
> symbolic link pointing to ../../lib/file/magic.mgc. If I create a symbolic
> link from /usr/share/misc/magic.mgc to /usr/lib/file/magic.mgc it starts
> working again.

The /usr/share/misc/magic.mgc is shipped by libmagic-mgc so someone or
something must have removed it later. Do you have traces of your upgrade
path, like old version, new version or additional messages? The files
/var/log/apt/term.log and /var/log/dpkg.log should provide some information.

FWIW, I test-upgraded a jessie-i386 chroot, everything worked as expected.

    Christoph

signature.asc (836 bytes) Download Attachment