]> granicus.if.org Git - php/commitdiff
Fix crypt_r detection
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 24 Jun 2020 10:08:31 +0000 (12:08 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 24 Jun 2020 10:09:49 +0000 (12:09 +0200)
And force use of our own php_crypt_r implementation to keep
previous behavior despite that.

configure.ac
ext/standard/config.m4

index df2c205f1973d1fca1dbfb86d1b5db3be932d8fc..2a62ca6eb807121dca26ec22ea746679061bee0a 100644 (file)
@@ -531,7 +531,6 @@ alphasort \
 asctime_r \
 chroot \
 ctime_r \
-crypt \
 explicit_memset \
 flock \
 ftok \
@@ -648,11 +647,6 @@ AC_FUNC_ALLOCA
 PHP_TIME_R_TYPE
 PHP_CHECK_IN_ADDR_T
 
-AC_CHECK_FUNCS(crypt_r, [ php_crypt_r="1" ], [ php_crypt_r="0" ])
-if test "x$php_crypt_r" = "x1"; then
-  PHP_CRYPT_R_STYLE
-fi
-
 AC_CACHE_CHECK([for aarch64 CRC32 API], ac_cv_func___crc32d,
 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <arm_acle.h>]],[[__crc32d(0, 0);]])],[ac_cv_func___crc32d=yes],[ac_cv_func___crc32d="no"])])
 if test "$ac_cv_func___crc32d" = "yes"; then
index 9f82ab1afa1a7d113ddfb7b9a69723e88e11f9d5..5081a6b677f2226671359c21f70c0974afdc83c3 100644 (file)
@@ -51,14 +51,10 @@ if test "$ac_cv_flush_io" = "yes"; then
   AC_DEFINE(HAVE_FLUSHIO, 1, [Define if flush should be called explicitly after a buffered io.])
 fi
 
-dnl
-dnl Check for crypt() capabilities
-dnl
-if test "$ac_cv_func_crypt" = "no"; then
-  AC_CHECK_LIB(crypt, crypt, [
-    LIBS="-lcrypt $LIBS -lcrypt"
-    AC_DEFINE(HAVE_CRYPT, 1, [ ])
-  ])
+PHP_CHECK_FUNC(crypt, crypt)
+PHP_CHECK_FUNC(crypt_r, crypt)
+if test "$ac_cv_func_crypt_r" = "yes"; then
+  PHP_CRYPT_R_STYLE
 fi
 
 AC_CACHE_CHECK(for standard DES crypt, ac_cv_crypt_des,[
@@ -262,7 +258,8 @@ int main() {
 dnl
 dnl If one of them is missing, use our own implementation, portable code is then possible
 dnl
-if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "$ac_cv_crypt_md5" = "no" || test "$ac_cv_crypt_sha512" = "no" || test "$ac_cv_crypt_sha256" = "no" || test "x$php_crypt_r" = "x0"; then
+dnl TODO This is currently always enabled
+if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "$ac_cv_crypt_md5" = "no" || test "$ac_cv_crypt_sha512" = "no" || test "$ac_cv_crypt_sha256" = "no" || test "$ac_cv_func_crypt_r" != "yes" || true; then
 
   dnl
   dnl Check for __alignof__ support in the compiler