[packages/php/PHP_5_6] Rel 24; use crypt() from system

arekm arekm at pld-linux.org
Wed Mar 13 21:59:24 CET 2024


commit 9c9eb4d6f66601e1cb2c6b56e7efdc3fa852a06c
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Mar 13 21:51:15 2024 +0100

    Rel 24; use crypt() from system

 crypt.patch | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 php.spec    |  8 ++++--
 2 files changed, 93 insertions(+), 2 deletions(-)
---
diff --git a/php.spec b/php.spec
index 5ab2a4a..83381db 100644
--- a/php.spec
+++ b/php.spec
@@ -155,7 +155,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine	with_filter
 %endif
 
-%define		rel	23
+%define		rel	24
 %define		orgname	php
 %define		ver_suffix 56
 %define		php_suffix %{!?with_default_php:%{ver_suffix}}
@@ -198,6 +198,7 @@ Patch9:		libtool-tag.patch
 Patch10:	%{orgname}-ini.patch
 Patch11:	embed.patch
 Patch12:	openssl.patch
+Patch13:	crypt.patch
 Patch14:	%{orgname}-no_pear_install.patch
 Patch17:	%{orgname}-readline.patch
 Patch18:	%{orgname}-nohttpd.patch
@@ -2108,7 +2109,7 @@ cp -p php.ini-production php.ini
 %patch10 -p1
 
 %patch12 -p1
-
+%patch13 -p1
 %patch14 -p1
 %patch17 -p1
 %patch18 -p1
@@ -2692,6 +2693,9 @@ chmod +x run-tests.sh
 cp -pf php_config.h.cli main/php_config.h
 cp -pf Makefile.cli Makefile
 
+# check if php is using system crypt()
+[ "$(./sapi/cli/php -r "echo crypt('test', '\$y\$j9T\$0123456789012345678901');")" == '$y$j9T$0123456789012345678901$QL0ChzHK2m7dGOwWHcpmRAp6FaInfsIzIDF4mVQdIFA' ] || exit 1
+
 ./run-tests.sh -w failed.log -s tests.log || {
 rc=$?
 
diff --git a/crypt.patch b/crypt.patch
new file mode 100644
index 0000000..e2cce66
--- /dev/null
+++ b/crypt.patch
@@ -0,0 +1,87 @@
+--- php-5.6.40/configure.in~	2024-03-13 20:25:10.000000000 +0100
++++ php-5.6.40/configure.in	2024-03-13 20:36:57.496650674 +0100
+@@ -610,7 +610,6 @@ asctime_r \
+ chroot \
+ ctime_r \
+ cuserid \
+-crypt \
+ flock \
+ ftok \
+ funopen \
+@@ -689,6 +688,11 @@ asprintf \
+ nanosleep \
+ )
+ 
++AC_SEARCH_LIBS([crypt], [crypt], [
++               LIBS="$LIBS -lcrypt"
++               AC_DEFINE(HAVE_CRYPT, 1, [ ])
++               ])
++
+ dnl Some systems (like OpenSolaris) do not have nanosleep in libc
+ PHP_CHECK_FUNC_LIB(nanosleep, rt)
+ 
+@@ -757,7 +761,7 @@ PHP_TIME_R_TYPE
+ PHP_READDIR_R_TYPE
+ PHP_CHECK_IN_ADDR_T
+ 
+-AC_CHECK_FUNCS(crypt_r, [ php_crypt_r="1" ], [ php_crypt_r="0" ])
++AC_SEARCH_LIBS(crypt_r, crypt, [ php_crypt_r="1" ], [ php_crypt_r="0" ])
+ if test "x$php_crypt_r" = "x1"; then
+   PHP_CRYPT_R_STYLE
+ fi
+--- php-5.6.40/ext/standard/config.m4~	2019-01-09 10:54:13.000000000 +0100
++++ php-5.6.40/ext/standard/config.m4	2024-03-13 21:03:19.596650607 +0100
+@@ -69,6 +69,8 @@ AC_CACHE_CHECK(for standard DES crypt, a
+ #include <crypt.h>
+ #endif
+ 
++#include <stdlib.h>
++
+ int main() {
+ #if HAVE_CRYPT
+ 	char *encrypted = crypt("rasmuslerdorf","rl");
+@@ -94,6 +96,8 @@ AC_CACHE_CHECK(for extended DES crypt, a
+ #include <crypt.h>
+ #endif
+ 
++#include <stdlib.h>
++
+ int main() {
+ #if HAVE_CRYPT
+ 	char *encrypted = crypt("rasmuslerdorf","_J9..rasm");
+@@ -119,6 +123,8 @@ AC_TRY_RUN([
+ #include <crypt.h>
+ #endif
+ 
++#include <stdlib.h>
++
+ int main() {
+ #if HAVE_CRYPT
+ 	char salt[15], answer[40];
+@@ -154,6 +160,8 @@ AC_TRY_RUN([
+ #include <crypt.h>
+ #endif
+ 
++#include <stdlib.h>
++
+ int main() {
+ #if HAVE_CRYPT
+ 	char salt[30], answer[70];
+@@ -186,6 +194,8 @@ AC_TRY_RUN([
+ #include <crypt.h>
+ #endif
+ 
++#include <stdlib.h>
++
+ int main() {
+ #if HAVE_CRYPT
+ 	char salt[21], answer[21+86];
+@@ -217,6 +227,8 @@ AC_TRY_RUN([
+ #include <crypt.h>
+ #endif
+ 
++#include <stdlib.h>
++
+ int main() {
+ #if HAVE_CRYPT
+ 	char salt[21], answer[21+43];
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/9c9eb4d6f66601e1cb2c6b56e7efdc3fa852a06c



More information about the pld-cvs-commit mailing list