Results 1 to 8 of 8

Thread: 'file' command broken in 9.10 (works in 9.04)

  1. #1
    Join Date
    Jun 2005
    Beans
    23

    'file' command broken in 9.10 (works in 9.04)

    I'm having a rather strange issue.

    I am using the Fileinfo extension to PHP to detect the contents of uploaded files. It works great and returns results like "video/mpeg" in Ubuntu 9.04.

    However, in 9.10 it's returning "application/octet-stream".

    The same issue is noted with the 'file' command, so I suspect it's a system level issue.

    Can anyone offer any insight as to how to fix this?

  2. #2
    Join Date
    Sep 2006
    Beans
    1,610
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: 'file' command broken in 9.10 (works in 9.04)

    From the file man page:

    "MAGIC DIRECTORY
    ...
    The order of entries in the magic file is significant. Depending on what system you are using, the order that they are put together may be incorrect."

    Check out your /etc/magic file. (I was a bit surprised)

    You can grab one from a Jaunty CD, or there are plenty of them available elsewhere.
    sı ɯǝ1qoɹd ɹnoʎ ʇɐɥʍ ǝǝs ı ʞuıɥʇ ı

  3. #3
    Join Date
    Jun 2005
    Beans
    23

    Re: 'file' command broken in 9.10 (works in 9.04)

    Ubuntu9.10$ file --version
    file-5.03
    magic file from /etc/magic:/usr/share/misc/magic

    Ubuntu9.04$ file --version
    file-4.26
    magic file from /etc/magic:/usr/share/file/magic

    /etc/magic has only a couple comments (in 9.10 and 9.04)
    /usr/share/misc/magic is a symlink to ../file/magic

    Checking /usr/share/misc/magic in 9.10 and 9.04 have several differences.

    Hmmm...

  4. #4
    Join Date
    Sep 2006
    Beans
    1,610
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: 'file' command broken in 9.10 (works in 9.04)

    So make a copy of the existing magic file and copy the one from a 9.04 iso. See if it works as expected. That's easier than trying to trace how the diffs will be interpreted.
    sı ɯǝ1qoɹd ɹnoʎ ʇɐɥʍ ǝǝs ı ʞuıɥʇ ı

  5. #5
    Join Date
    Jun 2005
    Beans
    23

    Re: 'file' command broken in 9.10 (works in 9.04)

    Copying the files in /usr/share/file/ over has no effect. I'm going to try installing the old version of file.

  6. #6
    Join Date
    Jun 2005
    Beans
    23

    Re: 'file' command broken in 9.10 (works in 9.04)

    Manually installing

    libmagic1_4.26-2ubuntu3_amd64.deb
    file_4.26-2ubuntu3_amd64.deb

    from Jaunty solves the problem.

  7. #7
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,510
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: 'file' command broken in 9.10 (works in 9.04)

    Quote Originally Posted by Mark Rose View Post
    Manually installing

    libmagic1_4.26-2ubuntu3_amd64.deb
    file_4.26-2ubuntu3_amd64.deb

    from Jaunty solves the problem.
    It solves your problem. Put in a proper bug report so the developers know about the issue.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  8. #8
    Join Date
    Jun 2005
    Beans
    23

    Re: 'file' command broken in 9.10 (works in 9.04)

    Quote Originally Posted by dcstar View Post
    It solves your problem. Put in a proper bug report so the developers know about the issue.
    Already did

    I guess I should have linked it here, too.

    https://bugs.launchpad.net/bugs/486085

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •