Bug 235110

Summary: Failed to load magic database at '/usr/share/misc/magic'
Product: [Fedora] Fedora Reporter: Robert Scheck <redhat-bugzilla>
Component: php-pecl-FileinfoAssignee: Brandon Holbrook <fedora>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: thh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-04-16 15:44:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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]