[curl/f18] show proper host name on failed resolve (#957173)
Kamil Dudka
kdudka at fedoraproject.org
Fri Apr 26 15:11:57 UTC 2013
commit 72ef860b718a8aa3c038f05cd7588b779c159575
Author: Kamil Dudka <kdudka at redhat.com>
Date: Fri Apr 26 16:54:13 2013 +0200
show proper host name on failed resolve (#957173)
0012-curl-7.27.0-25e577b3.patch | 86 +++++++++++++++++++++++++++++++++++++++
curl.spec | 9 ++++-
2 files changed, 94 insertions(+), 1 deletions(-)
---
diff --git a/0012-curl-7.27.0-25e577b3.patch b/0012-curl-7.27.0-25e577b3.patch
new file mode 100644
index 0000000..4b6ec7d
--- /dev/null
+++ b/0012-curl-7.27.0-25e577b3.patch
@@ -0,0 +1,86 @@
+From 461a96d26c08fcd27fc0ab2c94574461a85782bf Mon Sep 17 00:00:00 2001
+From: Kim Vandry <vandry at users.sf.net>
+Date: Mon, 18 Feb 2013 21:36:34 +0100
+Subject: [PATCH] Curl_resolver_is_resolved: show proper host name on failed resolve
+
+[upstream commit 25e577b33d00afb6630cf2cac98d6baa319e9aef]
+
+Signed-off-by: Kamil Dudka <kdudka at redhat.com>
+---
+ lib/asyn-thread.c | 35 ++++++++++++++++++++---------------
+ 1 files changed, 20 insertions(+), 15 deletions(-)
+
+diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
+index b027144..5552810 100644
+--- a/lib/asyn-thread.c
++++ b/lib/asyn-thread.c
+@@ -436,8 +436,19 @@ static const char *gai_strerror(int ecode)
+ * error
+ */
+
+-static void resolver_error(struct connectdata *conn, const char *host_or_proxy)
++static CURLcode resolver_error(struct connectdata *conn)
+ {
++ const char *host_or_proxy;
++ CURLcode rc;
++ if(conn->bits.httpproxy) {
++ host_or_proxy = "proxy";
++ rc = CURLE_COULDNT_RESOLVE_PROXY;
++ }
++ else {
++ host_or_proxy = "host";
++ rc = CURLE_COULDNT_RESOLVE_HOST;
++ }
++
+ failf(conn->data, "Could not resolve %s: %s; %s", host_or_proxy,
+ conn->async.hostname,
+ #ifdef HAVE_GAI_STRERROR
+@@ -448,6 +459,7 @@ static void resolver_error(struct connectdata *conn, const char *host_or_proxy)
+ Curl_strerror(conn, conn->async.status)
+ #endif
+ );
++ return rc;
+ }
+
+ /*
+@@ -479,17 +491,9 @@ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
+ if(entry)
+ *entry = conn->async.dns;
+
+- if(!conn->async.dns) {
+- /* a name was not resolved */
+- if(conn->bits.httpproxy) {
+- resolver_error(conn, "proxy");
+- rc = CURLE_COULDNT_RESOLVE_PROXY;
+- }
+- else {
+- resolver_error(conn, "host");
+- rc = CURLE_COULDNT_RESOLVE_HOST;
+- }
+- }
++ if(!conn->async.dns)
++ /* a name was not resolved, report error */
++ rc = resolver_error(conn);
+
+ destroy_async_data(&conn->async);
+
+@@ -524,12 +528,13 @@ CURLcode Curl_resolver_is_resolved(struct connectdata *conn,
+
+ if(done) {
+ getaddrinfo_complete(conn);
+- destroy_async_data(&conn->async);
+
+ if(!conn->async.dns) {
+- resolver_error(conn, "host");
+- return CURLE_COULDNT_RESOLVE_HOST;
++ CURLcode rc = resolver_error(conn);
++ destroy_async_data(&conn->async);
++ return rc;
+ }
++ destroy_async_data(&conn->async);
+ *entry = conn->async.dns;
+ }
+ else {
+--
+1.7.1
+
diff --git a/curl.spec b/curl.spec
index d4b22cd..5db959b 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
Name: curl
Version: 7.27.0
-Release: 8%{?dist}
+Release: 9%{?dist}
License: MIT
Group: Applications/Internet
Source: http://curl.haxx.se/download/%{name}-%{version}.tar.lzma
@@ -41,6 +41,9 @@ Patch10: 0010-curl-7.27.0-57ccdfa8.patch
# fix cookie tailmatching to prevent cross-domain leakage (CVE-2013-1944)
Patch11: 0011-curl-7.27.0-2eb8dcf2.patch
+# show proper host name on failed resolve (#957173)
+Patch12: 0012-curl-7.27.0-25e577b3.patch
+
# patch making libcurl multilib ready
Patch101: 0101-curl-7.27.0-multilib.patch
@@ -145,6 +148,7 @@ documentation of the library, too.
%patch9 -p1
%patch10 -p1
%patch11 -p1
+%patch12 -p1
# Fedora patches
%patch101 -p1
@@ -268,6 +272,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/aclocal/libcurl.m4
%changelog
+* Fri Apr 26 2013 Kamil Dudka <kdudka at redhat.com> 7.27.0-9
+- show proper host name on failed resolve (#957173)
+
* Fri Apr 12 2013 Kamil Dudka <kdudka at redhat.com> 7.27.0-8
- fix cookie tailmatching to prevent cross-domain leakage (CVE-2013-1944)
More information about the scm-commits
mailing list