drop inet_ntoa usage using upstream patch

Related: RHEL-14705
This commit is contained in:
Remi Collet 2023-11-29 10:11:42 +01:00
parent 7dd189ceab
commit 7f1e4615aa
2 changed files with 36 additions and 1 deletions

View File

@ -30,9 +30,11 @@
Name: php-pecl-xdebug3
Summary: Provides functions for function traces and profiling
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
Release: 1%{?dist}
Release: 2%{?dist}
Source0: https://github.com/%{pecl_name}/%{pecl_name}/archive/%{gh_commit}/%{pecl_name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz
Patch0: %{pecl_name}-deprecated.patch
License: Xdebug-1.03
URL: https://xdebug.org/
@ -86,6 +88,8 @@ mv NTS/package.xml .
sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml
cd NTS
%patch -P0 -p1 -b .deprecated
# Check extension version
ver=$(sed -n '/XDEBUG_VERSION/{s/.* "//;s/".*$//;p}' php_xdebug.h)
if test "$ver" != "%{upstream_version}%{?upstream_prever}%{?gh_date:-dev}"; then
@ -215,6 +219,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
* Wed Nov 29 2023 Remi Collet <rcollet@redhat.com> - 3.2.2-2
- drop inet_ntoa usage using upstream patch
* Mon Nov 27 2023 Remi Collet <rcollet@redhat.com> - 3.2.2-1
- update to 3.2.2 for PHP 8.2 RHEL-14705

28
xdebug-deprecated.patch Normal file
View File

@ -0,0 +1,28 @@
From aa79e6e4eff65e722ef66ab61cb6aa20805a7dec Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 29 Nov 2023 08:59:52 +0100
Subject: [PATCH] Fixed issue #2217: Replace inet_ntoa with inet_ntop to
support IPv6 with xdebug://gateway
---
src/debugger/ip_info.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/debugger/ip_info.c b/src/debugger/ip_info.c
index 143fd722c..abe858c4a 100644
--- a/src/debugger/ip_info.c
+++ b/src/debugger/ip_info.c
@@ -222,11 +222,12 @@ char *xdebug_get_gateway_ip(void)
{
in_addr_t addr = 0;
char iface[IF_NAMESIZE];
+ char addrbuf[INET6_ADDRSTRLEN];
memset(iface, 0, sizeof(iface));
if (get_gateway_and_iface(&addr, iface)) {
- return xdstrdup(inet_ntoa(*(struct in_addr *) &addr));
+ return xdstrdup(inet_ntop(AF_INET, &addr, addrbuf, sizeof(addrbuf)));
}
return NULL;