Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 235110 - Failed to load magic database at '/usr/share/misc/magic'
Summary: Failed to load magic database at '/usr/share/misc/magic'
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: php-pecl-Fileinfo
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Brandon Holbrook
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-03 19:47 UTC by Robert Scheck
Modified: 2007-11-30 22:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-04-16 15:44:50 UTC


Attachments (Terms of Use)

Description Robert Scheck 2007-04-03 19:47:07 UTC
Description of problem:
Warning: finfo_open(): Failed to load magic database at '/usr/share/misc/
magic'. in /home/robert/test.php on line 2
Warning: finfo_file(): supplied argument is not a valid file_info resource in /
home/robert/test.php on line 3
Warning: finfo_close(): supplied argument is not a valid file_info resource in /
home/robert/test.php on line 4

The file test.php contains:
<?php
$finfo = finfo_open(FILEINFO_MIME);
echo finfo_file($finfo, "/bin/cp");
finfo_close($finfo);
?>

Version-Release number of selected component (if applicable):
php-pecl-Fileinfo-1.0.4-1

How reproducible:
Everytime, see above.

Actual results:
Not working php-pecl-Fileinfo package.

Expected results:
Working php-pecl-Fileinfo package.

Additional info:
A hackish workaround is "$finfo = finfo_open(FILEINFO_MIME, "/usr/share/file/
magic");" instead of "$finfo = finfo_open(FILEINFO_MIME);".

Comment 1 Tom Hughes 2007-04-10 10:24:29 UTC
I'm also seeing this - the wierd thing is that /usr/share/misc/magic does exist.
The only difference between it and /usr/share/file/magic is that it is a
symbolic link to the real one.

This appears to be a feature of libmagic - a test program that calls
magic_load() on /usr/share/misc/magic fails with "No such file or directory" as
the error.

So either libmagic (part of file) needs to be fixed, or the php-pecl-Filesize
configure script needs to ignore symbolic links when looking for a magic file to
use.

Comment 2 Brandon Holbrook 2007-04-16 15:44:50 UTC
Fixed in php-pecl-Fileinfo-1.0.4-2.fc[567]


Note You need to log in before you can comment on or make changes to this bug.