Hi Michael,
* Michael Piefel <[EMAIL PROTECTED]> [15. Mär. 2006]:
> The behaviour described in the report is the documented behaviour of
> file. You did not include any location in the local magic search path
> that contains a *.mime file. Note that the position of file???s standard
> magic files has changed, and the path /usr/share/misc/file/magic you
> gave is not valid anymore.

My local magic search path contains at least two *.mime
files.  Thus at least the error message is misleading.

I tried the almost same tests as in my bug report
<[EMAIL PROTECTED]> but gave more
attention to the existence of magic files.

The results are really strange:

     0 pit:/tmp/file$ ls -Altr
     total 732
     -rw-r--r-- 1 grfz grfz 232720 2004-12-06 12:17 libmagic1_4.12-1_i386.deb
     -rw-r--r-- 1 grfz grfz  28568 2004-12-06 12:17 file_4.12-1_i386.deb
     -rw-r--r-- 1 grfz grfz 259404 2005-10-14 16:47 libmagic1_4.15-2_i386.deb
     -rw-r--r-- 1 grfz grfz  30316 2005-10-14 16:47 file_4.15-2_i386.deb
     -rwx------ 1 grfz grfz 164864 2006-03-15 20:02 ms-word-file.doc*
     0 pit:/tmp/file$ apt-cache policy file
     file:
       Installed: 4.12-1
       Candidate: 4.15-2
       Version table:
          4.15-2 0
             500 file: unstable/main Packages
             500 ftp://ftp.fu-berlin.de unstable/main Packages
             500 ftp://ftp.de.debian.org unstable/main Packages
      *** 4.12-1 0
             100 /var/lib/dpkg/status
     0 pit:/tmp/file$ dpkg -L file
     /.
     /etc
     /etc/magic
     /usr
     /usr/bin
     /usr/bin/file
     /usr/share
     /usr/share/man
     /usr/share/man/man1
     /usr/share/man/man1/file.1.gz
     /usr/share/bug
     /usr/share/bug/file
     /usr/share/bug/file/presubj
     /usr/share/doc
     /usr/share/doc/file
     /usr/share/doc/file/ChangeLog.gz
     /usr/share/doc/file/copyright
     /usr/share/doc/file/changelog.Debian.gz
     0 pit:/tmp/file$ dpkg -L libmagic1
     /.
     /usr
     /usr/lib
     /usr/lib/libmagic.so.1.0.0
     /usr/share
     /usr/share/misc
     /usr/share/misc/file
     /usr/share/misc/file/magic
     /usr/share/misc/file/magic.mime
     /usr/share/misc/file/magic.mgc
     /usr/share/misc/file/magic.mime.mgc
     /usr/share/man
     /usr/share/man/man5
     /usr/share/man/man5/magic.5.gz
     /usr/share/bug
     /usr/share/bug/libmagic1
     /usr/share/bug/libmagic1/control
     /usr/share/bug/libmagic1/presubj
     /usr/share/doc
     /usr/share/doc/libmagic1
     /usr/share/doc/libmagic1/copyright
     /usr/share/doc/libmagic1/changelog.Debian.gz
     /usr/lib/libmagic.so.1
     0  pit:/tmp/file$ ls -Altr ~/.magic{,.*} ~/.mutt/.magic{,.*} 
/etc/magic{,.*} /usr/share/misc/file/magic{,.*}
     ls: /home/grfz/.magic: No such file or directory
     ls: /home/grfz/.magic.*: No such file or directory
     -rw-r--r-- 1 root root   1447 2004-07-09 17:46 /etc/magic
     -rw-r--r-- 1 root root    112 2004-07-09 17:51 /etc/magic.mime
     -rw-r--r-- 1 root root  30429 2004-12-06 10:55 
/usr/share/misc/file/magic.mime
     -rw-r--r-- 1 root root 385258 2004-12-06 10:55 /usr/share/misc/file/magic
     -rw-r--r-- 1 root root  41728 2004-12-06 10:55 
/usr/share/misc/file/magic.mime.mgc
     -rw-r--r-- 1 root root 810880 2004-12-06 10:55 
/usr/share/misc/file/magic.mgc
     -rw-r--r-- 1 grfz grfz 321749 2005-05-08 20:29 /home/grfz/.mutt/.magic.mime
     -rw-r--r-- 1 grfz grfz 321749 2005-05-08 20:29 /home/grfz/.mutt/.magic
     2 pit:/tmp/file$ file -m 
~/.magic:~/.mutt/.magic:/etc/magic:/usr/share/misc/file/magic -bi 
ms-word-file.doc
     application/msword

Note this invokation of   file   works flawlessly (see exit code
of command at the beginning of the next line of output on the
terminal) although neither   ~/.magic   nor   ~/.magic.mime
exists.  But some of them exist.

     0 pit:/tmp/file$ sudo dpkg -i libmagic1_4.15-2_i386.deb 
file_4.15-2_i386.deb
     (Reading database ... 131763 files and directories currently installed.)
     Preparing to replace libmagic1 4.12-1 (using libmagic1_4.15-2_i386.deb) ...
     Unpacking replacement libmagic1 ...
     Preparing to replace file 4.12-1 (using file_4.15-2_i386.deb) ...
     Unpacking replacement file ...
     Setting up libmagic1 (4.15-2) ...

     Setting up file (4.15-2) ...
     0 pit:/tmp/file$ apt-cache policy file
     file:
       Installed: 4.15-2
       Candidate: 4.15-2
       Version table:
      *** 4.15-2 0
             500 file: unstable/main Packages
             500 ftp://ftp.fu-berlin.de unstable/main Packages
             500 ftp://ftp.de.debian.org unstable/main Packages
             100 /var/lib/dpkg/status
     0 pit:/tmp/file$ dpkg -L file
     /.
     /etc
     /etc/magic
     /usr
     /usr/bin
     /usr/bin/file
     /usr/share
     /usr/share/man
     /usr/share/man/man1
     /usr/share/man/man1/file.1.gz
     /usr/share/bug
     /usr/share/bug/file
     /usr/share/bug/file/presubj
     /usr/share/doc
     /usr/share/doc/file
     /usr/share/doc/file/changelog.gz
     /usr/share/doc/file/copyright
     /usr/share/doc/file/changelog.Debian.gz
     0 pit:/tmp/file$ dpkg -L libmagic1
     /.
     /usr
     /usr/lib
     /usr/lib/libmagic.so.1.0.0
     /usr/share
     /usr/share/file
     /usr/share/file/magic
     /usr/share/file/magic.mime
     /usr/share/file/magic.mgc
     /usr/share/file/magic.mime.mgc
     /usr/share/man
     /usr/share/man/man5
     /usr/share/man/man5/magic.5.gz
     /usr/share/bug
     /usr/share/bug/libmagic1
     /usr/share/bug/libmagic1/control
     /usr/share/bug/libmagic1/presubj
     /usr/share/doc
     /usr/share/doc/libmagic1
     /usr/share/doc/libmagic1/changelog.gz
     /usr/share/doc/libmagic1/copyright
     /usr/share/doc/libmagic1/changelog.Debian.gz
     /usr/lib/libmagic.so.1
     0 pit:/tmp/file$ ls -Altr ~/.magic{,.*} ~/.mutt/.magic{,.*} 
/etc/magic{,.*} /usr/share/misc/file/magic{,.*}
     ls: /home/grfz/.magic: No such file or directory
     ls: /home/grfz/.magic.*: No such file or directory
     ls: /usr/share/misc/file/magic: No such file or directory
     ls: /usr/share/misc/file/magic.*: No such file or directory
     -rw-r--r-- 1 root root   1447 2004-07-09 17:46 /etc/magic
     -rw-r--r-- 1 root root    112 2004-07-09 17:51 /etc/magic.mime
     -rw-r--r-- 1 grfz grfz 321749 2005-05-08 20:29 /home/grfz/.mutt/.magic.mime
     -rw-r--r-- 1 grfz grfz 321749 2005-05-08 20:29 /home/grfz/.mutt/.magic
     2 pit:/tmp/file$ file -m 
~/.magic:~/.mutt/.magic:/etc/magic:/usr/share/misc/file/magic -bi 
ms-word-file.doc
     file: could not find any magic files!

Note this invokation of   file   fails although some the files
given in the "alternate list of files  containing  magic
numbers" exists.  Therefore the error message is at least
misleading.

     1 pit:/tmp/file$ file -m ~/.mutt/.magic:/etc/magic -bi ms-word-file.doc
     application/x-archive
     0 pit:/tmp/file$ file -m ~/.mutt/.magic:/etc/magic:/usr/share/file/magic 
-bi ms-word-file.doc
     application/x-archive

Note this invokations work (but misidentify the ms-word-file.doc):
all of the files listed in the "alternate list of files containing
magic numbers" exist.

     0 pit:/tmp/file$ file -m 
~/.magic:~/.mutt/.magic:/etc/magic:/usr/share/file/magic -bi ms-word-file.doc
     application/msword
     0 pit:/tmp/file$

Note this invokation works (and correctly identifies the
ms-word-file.doc): The only difference to the above command
lines is the prepended "~/.magic:" in the "alternate
list of files containing magic numbers" but this prepended file
does not exist (nor does ~/.magic.mime, see above).

I then thought the problem might only arise with appended
non-existing files, but:

     0 pit:/tmp/file$ file -m 
~/.mutt/.magic:/etc/magic:/usr/share/file/magic:~/.magic -bi ms-word-file.doc
     application/x-archive

gives no error but also misidentifies the MS Word file.

Do you have any explanation for this result?

I think   file   should work without error when providing a
*search* path with at least ine existing *.mime file.

It would be nice if   file   would identify MS Word files as
application/ms-word.

Thanx for reading my bug report,
Gregor


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to