From b07efcd5a64c46e76749db4b68ad87cfe103dd22 Mon Sep 17 00:00:00 2001
From: Andy Postnikov <apostnikov@gmail.com>
Date: Thu, 6 Aug 2020 17:18:14 +0300
Subject: [PATCH] community/php7: upgrade to 7.4.9

---
 .../php7/78008-dns_check_record-74.patch      | 89 -------------------
 community/php7/APKBUILD                       |  8 +-
 2 files changed, 3 insertions(+), 94 deletions(-)
 delete mode 100644 community/php7/78008-dns_check_record-74.patch

diff --git a/community/php7/78008-dns_check_record-74.patch b/community/php7/78008-dns_check_record-74.patch
deleted file mode 100644
index c92b914776a6..000000000000
--- a/community/php7/78008-dns_check_record-74.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-commit 2c57378bd3725b82ac1217b636e21e3006b5ca03
-Author: Andy Postnikov <apostnikov@gmail.com>
-Date:   Tue Jul 14 04:14:05 2020 +0300
-
-    Fix bug #78008: dns_check_record() always return true on Alpine
-    
-    - free handle before return result
-    - cleaned up remaining usage of MAXPACKET
-    - update dns_get_mx() to use the same approach
-    
-    Closes GH-5854.
-
-diff --git a/ext/standard/dns.c b/ext/standard/dns.c
-index 4ee40aa5ec..705c8e4fad 100644
---- a/ext/standard/dns.c
-+++ b/ext/standard/dns.c
-@@ -349,10 +349,8 @@ static void _php_dns_free_res(struct __res_state *res) { /* {{{ */
-    Check DNS records corresponding to a given Internet host name or IP address */
- PHP_FUNCTION(dns_check_record)
- {
--#ifndef MAXPACKET
--#define MAXPACKET  8192 /* max packet size used internally by BIND */
--#endif
--	u_char ans[MAXPACKET];
-+	HEADER *hp;
-+	querybuf answer;
- 	char *hostname, *rectype = NULL;
- 	size_t hostname_len, rectype_len = 0;
- 	int type = T_MX, i;
-@@ -410,14 +408,14 @@ PHP_FUNCTION(dns_check_record)
- 	res_init();
- #endif
- 
--	RETVAL_TRUE;
--	i = php_dns_search(handle, hostname, C_IN, type, ans, sizeof(ans));
-+	i = php_dns_search(handle, hostname, C_IN, type, answer.qb2, sizeof answer);
-+	php_dns_free_handle(handle);
- 
- 	if (i < 0) {
--		RETVAL_FALSE;
-+		RETURN_FALSE;
- 	}
--
--	php_dns_free_handle(handle);
-+	hp = (HEADER *)&answer;
-+	RETURN_BOOL(ntohs(hp->ancount) != 0);
- }
- /* }}} */
- 
-@@ -1033,7 +1031,7 @@ PHP_FUNCTION(dns_get_mx)
- 	zval *mx_list, *weight_list = NULL;
- 	int count, qdc;
- 	u_short type, weight;
--	u_char ans[MAXPACKET];
-+	querybuf answer;
- 	char buf[MAXHOSTNAMELEN];
- 	HEADER *hp;
- 	u_char *cp, *end;
-@@ -1076,16 +1074,14 @@ PHP_FUNCTION(dns_get_mx)
- 	res_init();
- #endif
- 
--	i = php_dns_search(handle, hostname, C_IN, DNS_T_MX, (u_char *)&ans, sizeof(ans));
-+	i = php_dns_search(handle, hostname, C_IN, DNS_T_MX, answer.qb2, sizeof answer);
- 	if (i < 0) {
-+		php_dns_free_handle(handle);
- 		RETURN_FALSE;
- 	}
--	if (i > (int)sizeof(ans)) {
--		i = sizeof(ans);
--	}
--	hp = (HEADER *)&ans;
--	cp = (u_char *)&ans + HFIXEDSZ;
--	end = (u_char *)&ans +i;
-+	hp = (HEADER *)&answer;
-+	cp = answer.qb2 + HFIXEDSZ;
-+	end = answer.qb2 + i;
- 	for (qdc = ntohs((unsigned short)hp->qdcount); qdc--; cp += i + QFIXEDSZ) {
- 		if ((i = dn_skipname(cp, end)) < 0 ) {
- 			php_dns_free_handle(handle);
-@@ -1107,7 +1103,7 @@ PHP_FUNCTION(dns_get_mx)
- 			continue;
- 		}
- 		GETSHORT(weight, cp);
--		if ((i = dn_expand(ans, end, cp, buf, sizeof(buf)-1)) < 0) {
-+		if ((i = dn_expand(answer.qb2, end, cp, buf, sizeof(buf)-1)) < 0) {
- 			php_dns_free_handle(handle);
- 			RETURN_FALSE;
- 		}
diff --git a/community/php7/APKBUILD b/community/php7/APKBUILD
index 2985d345359c..63280f8a9961 100644
--- a/community/php7/APKBUILD
+++ b/community/php7/APKBUILD
@@ -25,8 +25,8 @@
 
 pkgname=php7
 _pkgreal=php
-pkgver=7.4.8
-pkgrel=2
+pkgver=7.4.9
+pkgrel=0
 _apiver=20190902
 _suffix=${pkgname#php}
 # Is this package the default (latest) PHP version?
@@ -101,7 +101,6 @@ source="https://php.net/distributions/$_pkgreal-$pkgver.tar.xz
 	php7-fpm-version-suffix.patch
 	fix-tests-devserver.patch
 	enchant-2.patch
-	78008-dns_check_record-74.patch
 	musl-time64.patch
 	"
 builddir="$srcdir/$_pkgreal-$pkgver"
@@ -674,7 +673,7 @@ _mv() {
 	mv "$@"
 }
 
-sha512sums="cfb23eac731a0eabed83908d7c056a123cd9a73ccc091d92b8601366da4cd95ded8623156eaa0458405f23d8bb9dc244d117bd99876f916ef582e3966dc78b44  php-7.4.8.tar.xz
+sha512sums="6179c2d867d6775d7f41785003c36d06ce620e7746ea7e6a4d275264e814a66d465776b47b04e2926ed1228cf58f2c15cdda74faf10372435c74ede7aeb79e18  php-7.4.9.tar.xz
 1c708de82d1086f272f484faf6cf6d087af7c31750cc2550b0b94ed723961b363f28a947b015b2dfc0765caea185a75f5d2c2f2b099c948b65c290924f606e4f  php7-fpm.initd
 cacce7bf789467ff40647b7319e3760c6c587218720538516e8d400baa75651f72165c4e28056cd0c1dc89efecb4d00d0d7823bed80b29136262c825ce816691  php7-fpm.logrotate
 274bd7b0b2b7002fa84c779640af37b59258bb37b05cb7dd5c89452977d71807f628d91b523b5039608376d1f760f3425d165242ca75ee5129b2730e71c4e198  php7-module.conf
@@ -685,5 +684,4 @@ ebf571c5e595221b9944d7e840807ebb68c1be38bf117186e19a3bd1070310ece5918bcaa5f94167
 16399fbf6a966f9beffe00f659f9551ef8e52285bca116da5bd5b15ec99a2b0bd5fa03be0faa6c893802aa44c100d634083343a9ac0cd2467812865df66dd572  php7-fpm-version-suffix.patch
 3bfeea79f9acfaa7be5bab85cd3d02713abb569e54024a22bb2c747c06d97f83ac2c63dcd75c7c409426ac03f8bc2ccc01bcd66bc39a767930d32542349123f9  fix-tests-devserver.patch
 7c8c3cac9efce81d525cb5a70e1402e393881b83ef4c7b5d39d3565803d21cd283daf3d74e9a8b059ecac66cf339756acc63608ffcb83d960dba86583bd45108  enchant-2.patch
-4cc2e56c00377917fa756b73e5587341230358c3a353dd880909c7d4119c29758f7ce7dea290575fbe9e109ee1b2236cb71be7c1b1a9a971389f7e58802a3456  78008-dns_check_record-74.patch
 1bdb4e692bd554dc3afd89ad8fd2532787a0ab099796fb938a5307bf9a12193f7758e574ccf585709c37c7d34f7b21137d794a32f843fbd94ace36437a83c77e  musl-time64.patch"
-- 
GitLab