Mail archive
alpine-aports

Re: [alpine-aports] [PATCH] testing/php7: Make php7 to use it's own crypt_r implementation insteard of system one

From: Timo Teras <timo.teras_at_iki.fi>
Date: Fri, 25 Mar 2016 08:29:37 +0200

On Thu, 24 Mar 2016 12:49:48 +0200
Valery Kartel <valery.kartel_at_gmail.com> wrote:

> Subject: PHP7 password_hash() crashes under Alpine Linux
> From: Andy Pfeiffer <apfeiffer.dresden_at_googlemail.com>
> Date: 24/03/2016 09:17 (EET)
>
> Hi Valery,
> sorry to contact you directly, but I don't have an account with
> Alpine Linux Development neither I'm going to create one. Issue is
> regarding PHP7 package using the following docker file:
>
> FROM alpine
>
> MAINTAINER xxxxx <xxxx.xxxxx_at_gmail.com>
>
> ENV PHP_VER "7"
>
> RUN apk update && \
> apk upgrade && \
> apk --no-cache --repository
> http://dl-cdn.alpinelinux.org/alpine/edge/testing add \ nano \
> readline \
> php${PHP_VER} \
> php${PHP_VER}-common \.
> php${PHP_VER}-fpm
>
> RUN echo "<?php echo password_hash(\"rasmuslerdorf\",
> PASSWORD_DEFAULT).\"\n\"; ?>" >> /pw_hash.php
>
> CMD ["/usr/bin/php7", "/pw_hash.php"]
>
> The output of the docker run command is:
>
> PHP Fatal error: Allowed memory size of 134217728 bytes exhausted
> (tried to allocate 8298485945901002016 bytes) in /pw_hash.php on line
> 1
>
> Using the PHP5 packages will give the (correct) result:
>
> $2y$10$de7p/1q2Xx/EyDpOp6ZBUOjf9gIqtrMR.r3Anh9B2lVCaJWPZSFs.
>
> If you can confirm the issue, please open a bug report.
>
> Thanks for supporting the community!
> With best regards,
> Andy
>
> btw: Would it be possible to create PHP7 packages for armhf
> (raspberry, bananapi, ...) too? ---
> testing/php7/APKBUILD | 12 ++++++++----
> testing/php7/use-internal-crypt_r.patch | 11 +++++++++++
> 2 files changed, 19 insertions(+), 4 deletions(-)
> create mode 100644 testing/php7/use-internal-crypt_r.patch
>
> diff --git a/testing/php7/APKBUILD b/testing/php7/APKBUILD
> index 8a56b5d..70a6c66 100644
> --- a/testing/php7/APKBUILD
> +++ b/testing/php7/APKBUILD
> _at_@ -3,7 +3,7 @@
> pkgname=php7
> _pkgreal=php
> pkgver=7.0.4
> -pkgrel=0
> +pkgrel=1
> pkgdesc="The PHP language runtime engine - 7th branch"
> url="http://www.php.net/"
> arch="x86_64 armhf"
> _at_@ -86,6 +86,7 @@
> source="http://php.net/distributions/$_pkgreal-$pkgver.tar.bz2
> tidy-buffio.patch includedir.patch
> pid_log.patch
> + use-internal-crypt_r.patch
> "
>
> _apiver="20151012"
> a/testing/php7/use-internal-crypt_r.patch
> b/testing/php7/use-internal-crypt_r.patch new file mode 100644 index
> 0000000..aafb48d --- /dev/null +++
> b/testing/php7/use-internal-crypt_r.patch _at_@ -0,0 +1,11 @@ +---
> a/configure.in ++++ b/configure.in +_at_@ -766,7 +766,7 @@
> + PHP_READDIR_R_TYPE
> + PHP_CHECK_IN_ADDR_T
> +
> +-AC_CHECK_FUNCS(crypt_r, [ php_crypt_r="1" ], [ php_crypt_r="0" ])
> ++AC_CHECK_FUNCS(crypt_r, [ php_crypt_r="0" ], [ php_crypt_r="0" ])
> + if test "x$php_crypt_r" = "x1"; then
> + PHP_CRYPT_R_STYLE
> + fi


I'd rather not break the configure script. Either remove the test, and
unconditionally define php_crypt_r=0; or preferable fix the underlying
cause.

In fact, in the main/php package we patch php to fix the crypt issue. I
can look at fixing it.


---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Fri Mar 25 2016 - 08:29:37 GMT