]> granicus.if.org Git - php/commitdiff
- Fixed bug #51435 (Missing ifdefs / logic bug in crypt code cause compile errors)
authorFelipe Pena <felipe@php.net>
Thu, 22 Apr 2010 20:54:35 +0000 (20:54 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 22 Apr 2010 20:54:35 +0000 (20:54 +0000)
ext/standard/config.m4
ext/standard/crypt.c

index 92982a94fccb08243fb7fb8405af1e253cbd23a5..4e3db0ffe442886e78067bcf27120aeb84047ce6 100644 (file)
@@ -306,6 +306,15 @@ else
   fi
   AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt])
 
+  if test "$ac_cv_crypt_md5" = "yes"; then
+    ac_result=1
+    ac_crypt_md5=1
+  else
+    ac_result=0
+    ac_crypt_md5=0
+  fi
+  AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, $ac_result, [Whether the system supports MD5 salt])  
+  
   if test "$ac_cv_crypt_sha512" = "yes"; then
     ac_result=1
     ac_crypt_sha512=1
@@ -313,7 +322,7 @@ else
     ac_result=0
     ac_crypt_sha512=0
   fi
-  AC_DEFINE_UNQUOTED(PHP_EXT_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt])
+  AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt])
 
   if test "$ac_cv_crypt_sha256" = "yes"; then
     ac_result=1
@@ -322,7 +331,7 @@ else
     ac_result=0
     ac_crypt_sha256=0
   fi
-  AC_DEFINE_UNQUOTED(PHP_EXT_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt])
+  AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt])
 
   AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 0, [Whether PHP has to use its own crypt_r for blowfish, des and ext des])
 fi
index 471daffbcd4c030f31bc33a2406ad22f1073780c..f66d58ab81d3e638b9d9eeb818fd4aa4f5b09f64 100644 (file)
@@ -29,7 +29,7 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#ifdef PHP_USE_PHP_CRYPT_R
+#if PHP_USE_PHP_CRYPT_R
 # include "php_crypt_r.h"
 # include "crypt_freesec.h"
 #else
@@ -116,7 +116,7 @@ PHP_MINIT_FUNCTION(crypt) /* {{{ */
    REGISTER_LONG_CONSTANT("CRYPT_SHA512", PHP_SHA512_CRYPT, CONST_CS | CONST_PERSISTENT);
 #endif
 
-#ifdef PHP_USE_PHP_CRYPT_R
+#if PHP_USE_PHP_CRYPT_R
        php_init_crypt_r();
 #endif
 
@@ -126,7 +126,7 @@ PHP_MINIT_FUNCTION(crypt) /* {{{ */
 
 PHP_MSHUTDOWN_FUNCTION(crypt) /* {{{ */
 {
-#ifdef PHP_USE_PHP_CRYPT_R
+#if PHP_USE_PHP_CRYPT_R
        php_shutdown_crypt_r();
 #endif