php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45636 fileinfo ext duplicate strndup
Submitted: 2008-07-27 07:14 UTC Modified: 2008-08-06 17:51 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: Fedora at FamilleCollet dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 5.3CVS-2008-07-27 (snap) OS: Linux (Fedora 9)
Private report: No CVE-ID: None
 [2008-07-27 07:14 UTC] Fedora at FamilleCollet dot com
Description:
------------
Fileinfo extention is now enabled by default but doesn't compile because it use "strndup" with is provided both by the system and the source (softmagic.c)

Source code of softmagic.c contain a test arround is local defined fonction :

#ifndef HAVE_STRNDUP
char * strndup(const char *, size_t);

...
#endif

But nothing set this macro.
I don't find anything in the .m4 files

Perhaps it should better use the zend_strndup ?

Reproduce code:
---------------
make


Expected result:
----------------
Build succed

Actual result:
--------------
/home/rpmbuild/BUILD/php5.3-200807270630/ext/fileinfo/libmagic/softmagic.c:305: error: expected identifier or '(' before '__extension__'
/home/rpmbuild/BUILD/php5.3-200807270630/ext/fileinfo/libmagic/softmagic.c:308: error: expected identifier or '(' before '__extension__'
make: *** [ext/fileinfo/libmagic/softmagic.lo] Error 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-27 09:13 UTC] jani@php.net
Compiles fine for me in Linux. What was the full configure line you used?
 [2008-07-27 15:26 UTC] Fedora at FamilleCollet dot com
First try with --enable-fileinfo=shared
Second try with --enable-fileinfo=shared,/usr

In fact, "file-devel" is installed, which provides libmagic.so and was used by PECL extension Fileinfo 1.0.4.

The bundled extension doesn't seem tu use the system library.

Regards
 [2008-07-27 15:30 UTC] jani@php.net
FYI: This extension only compiles with the bundled library. There is no way to use external libmagic anymore.

 [2008-07-27 15:59 UTC] Fedora at FamilleCollet dot com
ok,  thanks for the information about system lib.

So, error occur with bundled lib.
 [2008-07-29 21:03 UTC] jani@php.net
Assigned to the maintainer.
 [2008-08-06 14:43 UTC] derick@php.net
Committed in CVS, could you please verify that it works for you too now?
 [2008-08-06 17:05 UTC] Fedora at FamilleCollet dot com
Check with lastest snapshot (200808061630)

Build ok.

Thanks for the fix.

Regards
 [2008-08-06 17:51 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC