[curl/f17] show proper host name on failed resolve (#957173)

Kamil Dudka kdudka at fedoraproject.org
Fri Apr 26 15:25:19 UTC 2013


commit 091c1bdc336a688d93465a17a33d3b8904489d99
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Fri Apr 26 16:54:13 2013 +0200

    show proper host name on failed resolve (#957173)

 0009-curl-7.24.0-25e577b3.patch |   86 +++++++++++++++++++++++++++++++++++++++
 curl.spec                       |    9 ++++-
 2 files changed, 94 insertions(+), 1 deletions(-)
---
diff --git a/0009-curl-7.24.0-25e577b3.patch b/0009-curl-7.24.0-25e577b3.patch
new file mode 100644
index 0000000..4b6ec7d
--- /dev/null
+++ b/0009-curl-7.24.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 9a4fe75..e52b961 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.24.0
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: MIT
 Group: Applications/Internet
 Source: http://curl.haxx.se/download/%{name}-%{version}.tar.lzma
@@ -32,6 +32,9 @@ Patch7: 0007-curl-7.24.0-57ccdfa8.patch
 # fix cookie tailmatching to prevent cross-domain leakage (CVE-2013-1944)
 Patch8: 0008-curl-7.24.0-2eb8dcf2.patch
 
+# show proper host name on failed resolve (#957173)
+Patch9: 0009-curl-7.24.0-25e577b3.patch
+
 # patch making libcurl multilib ready
 Patch101: 0101-curl-7.21.1-multilib.patch
 
@@ -139,6 +142,7 @@ done
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
+%patch9 -p1
 
 # Fedora patches
 %patch101 -p1
@@ -252,6 +256,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/aclocal/libcurl.m4
 
 %changelog
+* Fri Apr 26 2013 Kamil Dudka <kdudka at redhat.com> 7.24.0-8
+- show proper host name on failed resolve (#957173)
+
 * Fri Apr 12 2013 Kamil Dudka <kdudka at redhat.com> 7.24.0-7
 - fix cookie tailmatching to prevent cross-domain leakage (CVE-2013-1944)
 


More information about the scm-commits mailing list