Bug 235110 - Failed to load magic database at '/usr/share/misc/magic'
Failed to load magic database at '/usr/share/misc/magic'
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: php-pecl-Fileinfo (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Brandon Holbrook
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-03 15:47 EDT by Robert Scheck
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-04-16 11:44:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Robert Scheck 2007-04-03 15:47:07 EDT
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 06:24:29 EDT
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 11:44:50 EDT
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.