FreeBSD Bugzilla – Attachment 229455 Details for
Bug 259725
lang/php74: dns_get_record fails when requested record doesn't exist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
php73 patch
0001-lang-php73-Fix-dns_get_record-glitch-when-requested-.patch (text/plain), 3.24 KB, created by
fsbruva
on 2021-11-12 20:48:49 UTC
(
hide
)
Description:
php73 patch
Filename:
MIME Type:
Creator:
fsbruva
Created:
2021-11-12 20:48:49 UTC
Size:
3.24 KB
patch
obsolete
>From 54e085358fcd1b97003a5b16e9ebd98ac81c8502 Mon Sep 17 00:00:00 2001 >From: Matt <fsbruva@yahoo.com> >Date: Fri, 12 Nov 2021 15:45:40 -0500 >Subject: [PATCH] lang/php73: Fix dns_get_record glitch when requested record > doesn't exist > >Correct behavior of dns_get_record to return all available requested records, >even if one or more record types do not exist for the domain. Currently, the >function returns boolean false, failing to return any valid records if one >of the requested record types doesn't exist. > >Upstream bug reports: >https://bugs.php.net/bug.php?id=70027 >https://bugs.php.net/bug.php?id=81618 > >PR: 259725 >--- > lang/php73/Makefile | 2 +- > lang/php73/files/patch-ext_standard_dns.c | 21 ++++++++++++++++ > .../php73/files/patch-ext_standard_php__dns.h | 24 +++++++++++++++++++ > 3 files changed, 46 insertions(+), 1 deletion(-) > create mode 100644 lang/php73/files/patch-ext_standard_dns.c > create mode 100644 lang/php73/files/patch-ext_standard_php__dns.h > >diff --git a/lang/php73/Makefile b/lang/php73/Makefile >index 073c4ea1d613..c833df123418 100644 >--- a/lang/php73/Makefile >+++ b/lang/php73/Makefile >@@ -1,6 +1,6 @@ > PORTNAME= php73 > DISTVERSION= 7.3.32 >-PORTREVISION?= 0 >+PORTREVISION?= 1 > CATEGORIES?= lang devel www > MASTER_SITES= PHP/distributions > DISTNAME= php-${DISTVERSION} >diff --git a/lang/php73/files/patch-ext_standard_dns.c b/lang/php73/files/patch-ext_standard_dns.c >new file mode 100644 >index 000000000000..ace90533b231 >--- /dev/null >+++ b/lang/php73/files/patch-ext_standard_dns.c >@@ -0,0 +1,21 @@ >+--- ext/standard/dns.c.orig 2021-10-26 15:07:06 UTC >++++ ext/standard/dns.c >+@@ -795,6 +795,7 @@ PHP_FUNCTION(dns_get_record) >+ zend_long type_param = PHP_DNS_ANY; >+ zval *authns = NULL, *addtl = NULL; >+ int type_to_fetch; >++ int dns_errno; >+ #if defined(HAVE_DNS_SEARCH) >+ struct sockaddr_storage from; >+ uint32_t fromsize = sizeof(from); >+@@ -940,8 +941,9 @@ PHP_FUNCTION(dns_get_record) >+ n = php_dns_search(handle, hostname, C_IN, type_to_fetch, answer.qb2, sizeof answer); >+ >+ if (n < 0) { >++ dns_errno = php_dns_errno(handle); >+ php_dns_free_handle(handle); >+- switch (h_errno) { >++ switch (dns_errno) { >+ case NO_DATA: >+ case HOST_NOT_FOUND: >+ continue; >diff --git a/lang/php73/files/patch-ext_standard_php__dns.h b/lang/php73/files/patch-ext_standard_php__dns.h >new file mode 100644 >index 000000000000..18668369aaf7 >--- /dev/null >+++ b/lang/php73/files/patch-ext_standard_php__dns.h >@@ -0,0 +1,24 @@ >+--- ext/standard/php_dns.h.orig 2021-10-26 15:07:06 UTC >++++ ext/standard/php_dns.h >+@@ -26,6 +26,7 @@ >+ ((int)dns_search(res, dname, class, type, answer, anslen, (struct sockaddr *)&from, &fromsize)) >+ #define php_dns_free_handle(res) \ >+ dns_free(res) >++#define php_dns_errno(handle) h_errno >+ >+ #elif defined(HAVE_RES_NSEARCH) >+ #define php_dns_search(res, dname, class, type, answer, anslen) \ >+@@ -39,11 +40,13 @@ >+ res_nclose(res); \ >+ php_dns_free_res(res) >+ #endif >++#define php_dns_errno(handle) handle->res_h_errno >+ >+ #elif defined(HAVE_RES_SEARCH) >+ #define php_dns_search(res, dname, class, type, answer, anslen) \ >+ res_search(dname, class, type, answer, anslen) >+ #define php_dns_free_handle(res) /* noop */ >++#define php_dns_errno(handle) h_errno >+ >+ #endif >+ >-- >2.33.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 259725
:
229369
|
229454
| 229455 |
229456