forked from pool/whois
Accepting request 497855 from home:AndreasStieger:branches:network:utilities
- build with libidn2 for IDNA 2008 support FATE#321897 - fix CIDR notation and also convert using IDNA 2008 transitional bsc#1026831, add whois-5.2.15-fix-CIDR-with-libidn2.patch OBS-URL: https://build.opensuse.org/request/show/497855 OBS-URL: https://build.opensuse.org/package/show/network:utilities/whois?expand=0&rev=78
This commit is contained in:
parent
9836be82ca
commit
b09ba8cf3d
76
whois-5.2.15-fix-CIDR-with-libidn2.patch
Normal file
76
whois-5.2.15-fix-CIDR-with-libidn2.patch
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
From d6e33ff64742f48f2022980fd4889ec36662cc30 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andreas Stieger <astieger@suse.com>
|
||||||
|
Date: Tue, 4 Apr 2017 18:27:37 +0200
|
||||||
|
Subject: [PATCH 1/2] Fix CIDR notation and IPv6 queries with libidn2
|
||||||
|
|
||||||
|
Fixes #50
|
||||||
|
Fixes https://bugzilla.opensuse.org/show_bug.cgi?id=1026831
|
||||||
|
Signed-off-by: Andreas Stieger <astieger@suse.com>
|
||||||
|
---
|
||||||
|
whois.c | 12 ++++++++++++
|
||||||
|
1 file changed, 12 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/whois.c b/whois.c
|
||||||
|
index 8f5f1f1..7259c7f 100644
|
||||||
|
--- a/whois.c
|
||||||
|
+++ b/whois.c
|
||||||
|
@@ -1172,6 +1172,12 @@ char *normalize_domain(const char *dom)
|
||||||
|
int prefix_len;
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBIDN2
|
||||||
|
+ /* skip CIDR notation */
|
||||||
|
+ if (NULL != strchr(domain_start, '/'))
|
||||||
|
+ return ret;
|
||||||
|
+ /* skip IPv6 */
|
||||||
|
+ if (NULL != strchr(domain_start, ':'))
|
||||||
|
+ return ret;
|
||||||
|
if (idn2_lookup_ul(domain_start, &q, IDN2_NONTRANSITIONAL) != IDN2_OK)
|
||||||
|
return ret;
|
||||||
|
#else
|
||||||
|
@@ -1193,6 +1199,12 @@ char *normalize_domain(const char *dom)
|
||||||
|
char *q;
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBIDN2
|
||||||
|
+ /* skip CIDR notation */
|
||||||
|
+ if (NULL != strchr(ret, '/'))
|
||||||
|
+ return ret;
|
||||||
|
+ /* skip IPv6 */
|
||||||
|
+ if (NULL != strchr(ret, ':'))
|
||||||
|
+ return ret;
|
||||||
|
if (idn2_lookup_ul(ret, &q, IDN2_NONTRANSITIONAL) != IDN2_OK)
|
||||||
|
return ret;
|
||||||
|
#else
|
||||||
|
|
||||||
|
From 1e6a7b3f0d585768f7136abda2db797c64159157 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andreas Stieger <astieger@suse.com>
|
||||||
|
Date: Tue, 23 May 2017 23:30:11 +0200
|
||||||
|
Subject: [PATCH 2/2] When using libidn2, also try IDNA 2008 transitional
|
||||||
|
|
||||||
|
---
|
||||||
|
whois.c | 6 ++++--
|
||||||
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/whois.c b/whois.c
|
||||||
|
index 7259c7f..00ca962 100644
|
||||||
|
--- a/whois.c
|
||||||
|
+++ b/whois.c
|
||||||
|
@@ -1179,7 +1179,8 @@ char *normalize_domain(const char *dom)
|
||||||
|
if (NULL != strchr(domain_start, ':'))
|
||||||
|
return ret;
|
||||||
|
if (idn2_lookup_ul(domain_start, &q, IDN2_NONTRANSITIONAL) != IDN2_OK)
|
||||||
|
- return ret;
|
||||||
|
+ if (idn2_lookup_ul(domain_start, &q, IDN2_TRANSITIONAL) != IDN2_OK)
|
||||||
|
+ return ret;
|
||||||
|
#else
|
||||||
|
if (idna_to_ascii_lz(domain_start, &q, 0) != IDNA_SUCCESS)
|
||||||
|
return ret;
|
||||||
|
@@ -1206,7 +1207,8 @@ char *normalize_domain(const char *dom)
|
||||||
|
if (NULL != strchr(ret, ':'))
|
||||||
|
return ret;
|
||||||
|
if (idn2_lookup_ul(ret, &q, IDN2_NONTRANSITIONAL) != IDN2_OK)
|
||||||
|
- return ret;
|
||||||
|
+ if (idn2_lookup_ul(ret, &q, IDN2_TRANSITIONAL) != IDN2_OK)
|
||||||
|
+ return ret;
|
||||||
|
#else
|
||||||
|
if (idna_to_ascii_lz(ret, &q, 0) != IDNA_SUCCESS)
|
||||||
|
return ret;
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue May 23 21:45:35 UTC 2017 - astieger@suse.com
|
||||||
|
|
||||||
|
- build with libidn2 for IDNA 2008 support FATE#321897
|
||||||
|
- fix CIDR notation and also convert using IDNA 2008 transitional
|
||||||
|
bsc#1026831, add whois-5.2.15-fix-CIDR-with-libidn2.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Feb 27 10:00:11 UTC 2017 - astieger@suse.com
|
Mon Feb 27 10:00:11 UTC 2017 - astieger@suse.com
|
||||||
|
|
||||||
|
@ -30,8 +30,10 @@ Source2: %{name}.keyring
|
|||||||
# rename .dsc to not build the package in OBS
|
# rename .dsc to not build the package in OBS
|
||||||
Source3: http://ftp.debian.org/debian/pool/main/w/whois/%{name}_%{version}.dsc#/%{name}.asc
|
Source3: http://ftp.debian.org/debian/pool/main/w/whois/%{name}_%{version}.dsc#/%{name}.asc
|
||||||
Patch0: whois-nobsdsource.patch
|
Patch0: whois-nobsdsource.patch
|
||||||
BuildRequires: libidn-devel
|
Patch1: whois-5.2.15-fix-CIDR-with-libidn2.patch
|
||||||
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: xz
|
BuildRequires: xz
|
||||||
|
BuildRequires: pkgconfig(libidn2)
|
||||||
Provides: ripe-whois-tools
|
Provides: ripe-whois-tools
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
%if 0%{?suse_version} != 1310
|
%if 0%{?suse_version} != 1310
|
||||||
@ -63,9 +65,10 @@ echo "`grep -A1 "Checksums-Sha256" %{SOURCE3} | grep %{name}_%{version}.tar.xz |
|
|||||||
|
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
|
%patch1 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make all mkpasswd HAVE_LIBIDN=1 HAVE_ICONV=1 %{?_smp_mflags} \
|
make all mkpasswd HAVE_LIBIDN2=1 HAVE_ICONV=1 %{?_smp_mflags} \
|
||||||
%if 0%{?suse_version} <= 1140
|
%if 0%{?suse_version} <= 1140
|
||||||
HAVE_XCRYPT=1 \
|
HAVE_XCRYPT=1 \
|
||||||
%else
|
%else
|
||||||
|
Loading…
Reference in New Issue
Block a user