From 6d0b351f0e6da9d677e8bfed8e1c24282294b24b Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 14 May 2025 15:22:35 +0000 Subject: [PATCH] import UBI perl-Socket-2.038-511.el10 --- .gitignore | 2 +- .perl-Socket.metadata | 1 - ...net_aton-Use-getaddrinfo-if-possible.patch | 66 --------- SPECS/perl-Socket.spec => perl-Socket.spec | 131 ++++++++++++++++-- sources | 1 + 5 files changed, 121 insertions(+), 80 deletions(-) delete mode 100644 .perl-Socket.metadata delete mode 100644 SOURCES/Socket-2.029-inet_aton-Use-getaddrinfo-if-possible.patch rename SPECS/perl-Socket.spec => perl-Socket.spec (66%) create mode 100644 sources diff --git a/.gitignore b/.gitignore index b91477d..5af4a82 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/Socket-2.029.tar.gz +Socket-2.038.tar.gz diff --git a/.perl-Socket.metadata b/.perl-Socket.metadata deleted file mode 100644 index a25572e..0000000 --- a/.perl-Socket.metadata +++ /dev/null @@ -1 +0,0 @@ -52b077e0502519aae775113c5a1a1ddf94c8e2d8 SOURCES/Socket-2.029.tar.gz diff --git a/SOURCES/Socket-2.029-inet_aton-Use-getaddrinfo-if-possible.patch b/SOURCES/Socket-2.029-inet_aton-Use-getaddrinfo-if-possible.patch deleted file mode 100644 index 124152b..0000000 --- a/SOURCES/Socket-2.029-inet_aton-Use-getaddrinfo-if-possible.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 0be99f8799e90eaed4e8eeb7d5be7de81dd71360 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= -Date: Thu, 11 Apr 2019 18:17:16 +0200 -Subject: [PATCH] inet_aton: Use getaddrinfo() if possible -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Socket::inet_aton() used gethostbyname() to process arguments that are -not an IP addres. However, gethostbyname() is not thread-safe and when -called from multiple threads a bogus value can be returned. - -This patch does add any new test because a basic inet_aton() usage is -already covered and because reproducing the thread failure would -require flodding DNS servers with thousounds of request. - - - - -Signed-off-by: Petr Písař ---- - Socket.xs | 16 +++++++++++++++- - 1 file changed, 15 insertions(+), 1 deletion(-) - -diff --git a/Socket.xs b/Socket.xs -index e46c93e..65244dd 100644 ---- a/Socket.xs -+++ b/Socket.xs -@@ -764,19 +764,33 @@ inet_aton(host) - char * host - CODE: - { -+#ifdef HAS_GETADDRINFO -+ struct addrinfo *res; -+ struct addrinfo hints = {0,}; -+ hints.ai_family = AF_INET; -+ if (!getaddrinfo(host, NULL, &hints, &res)) { -+ ST(0) = sv_2mortal(newSVpvn( -+ (char *)&(((struct sockaddr_in *)res->ai_addr)->sin_addr.s_addr), -+ 4 -+ )); -+ freeaddrinfo(res); -+ XSRETURN(1); -+ } -+#else - struct in_addr ip_address; - struct hostent * phe; -- - if ((*host != '\0') && inet_aton(host, &ip_address)) { - ST(0) = sv_2mortal(newSVpvn((char *)&ip_address, sizeof(ip_address))); - XSRETURN(1); - } - #ifdef HAS_GETHOSTBYNAME -+ /* gethostbyname is not thread-safe */ - phe = gethostbyname(host); - if (phe && phe->h_addrtype == AF_INET && phe->h_length == 4) { - ST(0) = sv_2mortal(newSVpvn((char *)phe->h_addr, phe->h_length)); - XSRETURN(1); - } -+#endif - #endif - XSRETURN_UNDEF; - } --- -2.20.1 - diff --git a/SPECS/perl-Socket.spec b/perl-Socket.spec similarity index 66% rename from SPECS/perl-Socket.spec rename to perl-Socket.spec index bd75ee5..0271cd1 100644 --- a/SPECS/perl-Socket.spec +++ b/perl-Socket.spec @@ -1,13 +1,12 @@ Name: perl-Socket Epoch: 4 -Version: 2.029 -Release: 4%{?dist} +Version: 2.038 +Release: 511%{?dist} Summary: Networking constants and support functions -License: GPL+ or Artistic +License: GPL-1.0-or-later OR Artistic-1.0-Perl URL: https://metacpan.org/release/Socket Source0: https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Socket-%{version}.tar.gz -# Make Socket::inet_aton() thread safe, CPAN RT#129189, bug #1693293 -Patch0: Socket-2.029-inet_aton-Use-getaddrinfo-if-possible.patch +BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc BuildRequires: make @@ -22,6 +21,7 @@ BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 BuildRequires: perl(strict) BuildRequires: perl(warnings) # Run-time: +BuildRequires: perl(:VERSION) >= 5.6.1 BuildRequires: perl(Carp) BuildRequires: perl(Exporter) # Scalar::Util is needed only if getaddrinfo(3) does not exist. Not our case. @@ -30,7 +30,7 @@ BuildRequires: perl(XSLoader) # Tests only: BuildRequires: perl(Errno) BuildRequires: perl(Test::More) -Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(:VERSION) >= 5.6.1 %{?perl_default_filter} @@ -42,30 +42,137 @@ socket(), setsockopt() and bind(). It also provides several other support functions, mostly for dealing with conversions of network addresses between human-readable and native binary forms, and for hostname resolver operations. +%package tests +Summary: Tests for %{name} +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: perl-Test-Harness + +%description tests +Tests from %{name}. Execute them +with "%{_libexecdir}/%{name}/test". + %prep %setup -q -n Socket-%{version} -%patch0 -p1 + +# Help file to recognise the Perl scripts +for F in t/*.t; do + perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F" + chmod +x "$F" +done %build -perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="$RPM_OPT_FLAGS" +perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1 OPTIMIZE="%{optflags}" %{make_build} %install %{make_install} -find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete -%{_fixperms} $RPM_BUILD_ROOT/* +find %{buildroot} -type f -name '*.bs' -size 0 -delete +%{_fixperms} %{buildroot}/* + +# Install tests +mkdir -p %{buildroot}%{_libexecdir}/%{name} +cp -a t %{buildroot}%{_libexecdir}/%{name} +cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF' +#!/bin/sh +cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)" +EOF +chmod +x %{buildroot}%{_libexecdir}/%{name}/test %check +export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}') make test %files %license Artistic Copying LICENSE %doc Changes -%{perl_vendorarch}/auto/* +%{perl_vendorarch}/auto/Socket* %{perl_vendorarch}/Socket* -%{_mandir}/man3/* +%{_mandir}/man3/Socket* + +%files tests +%{_libexecdir}/%{name} %changelog +* Tue Oct 29 2024 Troy Dawson - 4:2.038-511 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + +* Thu Jul 18 2024 Jitka Plesnikova - 4:2.038-510 +- Increase release to favour standalone package + +* Thu Jul 18 2024 Jitka Plesnikova - 4:2.038-1 +- 2.038 bump + +* Mon Jun 24 2024 Troy Dawson - 4:2.037-6 +- Bump release for June 2024 mass rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 4:2.037-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 4:2.037-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jul 21 2023 Fedora Release Engineering - 4:2.037-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jul 11 2023 Jitka Plesnikova - 4:2.037-2 +- Perl 5.38 rebuild + +* Tue Jun 06 2023 Jitka Plesnikova - 4:2.037-1 +- 2.037 bump + +* Fri Jan 20 2023 Fedora Release Engineering - 4:2.036-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Mon Aug 22 2022 Jitka Plesnikova - 4:2.036-1 +- 2.036 bump + +* Fri Jul 22 2022 Fedora Release Engineering - 4:2.035-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jul 11 2022 Jitka Plesnikova - 4:2.035-1 +- 2.035 bump + +* Tue Jun 28 2022 Jitka Plesnikova - 4:2.034-1 +- 2.034 bump + +* Mon May 30 2022 Jitka Plesnikova - 4:2.033-488 +- Increase release to favour standalone package + +* Mon May 02 2022 Jitka Plesnikova - 4:2.033-1 +- 2.033 bump + +* Fri Jan 21 2022 Fedora Release Engineering - 4:2.032-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Jul 22 2021 Fedora Release Engineering - 4:2.032-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jun 03 2021 Jitka Plesnikova - 4:2.032-1 +- 2.032 bump +- Package tests + +* Fri May 21 2021 Jitka Plesnikova - 4:2.031-477 +- Increase release to favour standalone package + +* Wed Jan 27 2021 Fedora Release Engineering - 4:2.031-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jan 06 2021 Jitka Plesnikova - 4:2.031-1 +- 2.031 bump + +* Tue Jul 28 2020 Fedora Release Engineering - 4:2.030-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 07 2020 Petr Pisar - 4:2.030-1 +- 2.030 bump + +* Mon Jun 22 2020 Jitka Plesnikova - 4:2.029-456 +- Increase release to favour standalone package + +* Thu Jan 30 2020 Fedora Release Engineering - 4:2.029-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Fri Jul 26 2019 Fedora Release Engineering - 4:2.029-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sources b/sources new file mode 100644 index 0000000..ec03ac9 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (Socket-2.038.tar.gz) = 68e2ed41e7c30cb3bc90c3fb3d2c4894fa6517f5828dec8f3700dd382b5539f581408324ed957b3708e1cec48c54d48f5b69b5089e04bb329699461859106cd5