From 8bbe66dae36544d91b255adbef8d52eb0b90eee3 Mon Sep 17 00:00:00 2001 From: Eivind Uggedal Date: Tue, 18 Aug 2015 14:19:17 +0000 Subject: [PATCH] php: fix crypt segfault on musl (patches from Alpine) --- srcpkgs/php/patches/fix-crypt-sha.patch | 20 ++++++++++++ srcpkgs/php/patches/fix-crypt.patch | 41 +++++++++++++++++++++++++ srcpkgs/php/template | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/php/patches/fix-crypt-sha.patch create mode 100644 srcpkgs/php/patches/fix-crypt.patch diff --git a/srcpkgs/php/patches/fix-crypt-sha.patch b/srcpkgs/php/patches/fix-crypt-sha.patch new file mode 100644 index 0000000000..f02e5bfbd5 --- /dev/null +++ b/srcpkgs/php/patches/fix-crypt-sha.patch @@ -0,0 +1,20 @@ +--- ext/standard/config.m4.orig ++++ ext/standard/config.m4 +@@ -314,7 +314,7 @@ + fi + AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, $ac_result, [Whether the system supports MD5 salt]) + +- if test "$ac_cv_crypt_sha512" = "yes"; then ++ if test "$ac_cv_crypt_SHA512" = "yes"; then + ac_result=1 + ac_crypt_sha512=1 + else +@@ -323,7 +323,7 @@ + fi + AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt]) + +- if test "$ac_cv_crypt_sha256" = "yes"; then ++ if test "$ac_cv_crypt_SHA256" = "yes"; then + ac_result=1 + ac_crypt_sha256=1 + else diff --git a/srcpkgs/php/patches/fix-crypt.patch b/srcpkgs/php/patches/fix-crypt.patch new file mode 100644 index 0000000000..03e1376ce7 --- /dev/null +++ b/srcpkgs/php/patches/fix-crypt.patch @@ -0,0 +1,41 @@ +Reported upstream: +https://bugs.php.net/bug.php?id=67512 + +--- ext/standard/crypt.c.orig 2014-06-25 13:10:38.930010191 -0300 ++++ ext/standard/crypt.c 2014-06-25 13:45:09.762124864 -0300 +@@ -228,18 +228,20 @@ + } + } + #else +- +-# if defined(HAVE_CRYPT_R) && (defined(_REENTRANT) || defined(_THREAD_SAFE)) + { +-# if defined(CRYPT_R_STRUCT_CRYPT_DATA) ++# if defined(HAVE_CRYPT_R) ++# if defined(CRYPT_R_STRUCT_CRYPT_DATA) + struct crypt_data buffer; + memset(&buffer, 0, sizeof(buffer)); +-# elif defined(CRYPT_R_CRYPTD) ++# elif defined(CRYPT_R_CRYPTD) + CRYPTD buffer; +-# else +-# error Data struct used by crypt_r() is unknown. Please report. +-# endif ++# else ++# error Data struct used by crypt_r() is unknown. Please report. ++# endif + crypt_res = crypt_r(password, salt, &buffer); ++# else ++ crypt_res = crypt(passwrd, salt); ++#endif + if (!crypt_res || (salt[0] == '*' && salt[1] == '0')) { + return FAILURE; + } else { +@@ -247,7 +249,6 @@ + return SUCCESS; + } + } +-# endif + #endif + } + /* }}} */ diff --git a/srcpkgs/php/template b/srcpkgs/php/template index 0b48669218..df6947b217 100644 --- a/srcpkgs/php/template +++ b/srcpkgs/php/template @@ -1,7 +1,7 @@ # Template build file for 'php' pkgname=php version=5.6.12 -revision=1 +revision=2 short_desc="An HTML-embedded scripting language" license="PHP" homepage="http://www.php.net"