PHP :: Bug #51435 :: Missing ifdefs
| Bug #51435 | Missing ifdefs / logic bug in crypt code cause compile errors | ||||
|---|---|---|---|---|---|
| Submitted: | 2010-03-30 12:05 UTC | Modified: | 2010-04-22 22:54 UTC | ||
| From: | joey@php.net | Assigned: | felipe (profile) | ||
| Status: | Closed | Package: | Compile Failure | ||
| PHP Version: | 5.3.2 | OS: | Ubuntu 9.10 | ||
| Private report: | No | CVE-ID: | None | ||
[2010-03-30 12:05 UTC] joey@php.net
Description:
------------
In ext/standard/config.m4, the following line causes conditional definition of the PHP_SHA256_CRYPT and PHP_SHA512_CRYPT constants:
if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "x$php_crypt_r" = "x0"; then
Because these symbols are used unconditionally in ext/standard/crypt.c, this can cause PHP to fail to compile.
In the near-term, the compile bug can be fixed as follows:
#ifdef PHP_SHA256_CRYPT
REGISTER_LONG_CONSTANT("CRYPT_SHA256", PHP_SHA256_CRYPT, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef PHP_SHA512_CRYPT
REGISTER_LONG_CONSTANT("CRYPT_SHA512", PHP_SHA512_CRYPT, CONST_CS | CONST_PERSISTENT);
#endif
However, the m4 logic should probably be revisited at some point.
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2010-04-22 22:54 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
[2010-04-22 22:54 UTC] felipe@php.net