diff options
author | roam <roam@FreeBSD.org> | 2009-06-23 16:49:07 +0800 |
---|---|---|
committer | roam <roam@FreeBSD.org> | 2009-06-23 16:49:07 +0800 |
commit | 7780033c4e9cb664a6dbbcb746b50763d4f5c728 (patch) | |
tree | 5aad08552d09941d2e5815513c3f054cefcfb29c /irc | |
parent | 5e3e28f8971d83eb556ff0a5834ec2618d36c602 (diff) | |
download | freebsd-ports-gnome-7780033c4e9cb664a6dbbcb746b50763d4f5c728.tar.gz freebsd-ports-gnome-7780033c4e9cb664a6dbbcb746b50763d4f5c728.tar.zst freebsd-ports-gnome-7780033c4e9cb664a6dbbcb746b50763d4f5c728.zip |
Fix the crash with c-ares-1.6.0.
Reported by: several
Submitted by: Ilya Andreev <admin@aivus.name>
Timeout: Gerrit Beine <gerrit.beine@gmx.de> (maintainer)
Diffstat (limited to 'irc')
-rw-r--r-- | irc/unreal/Makefile | 2 | ||||
-rw-r--r-- | irc/unreal/files/patch-res.c | 104 |
2 files changed, 105 insertions, 1 deletions
diff --git a/irc/unreal/Makefile b/irc/unreal/Makefile index 79d5dd095c5e..cb931a5976bd 100644 --- a/irc/unreal/Makefile +++ b/irc/unreal/Makefile @@ -7,7 +7,7 @@ PORTNAME= Unreal PORTVERSION= 3.2.7 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= irc ipv6 MASTER_SITES= http://unrealircd.pimpmylinux.org/ \ http://unrealircd.icedslash.com/ diff --git a/irc/unreal/files/patch-res.c b/irc/unreal/files/patch-res.c new file mode 100644 index 000000000000..e359baaf19c7 --- /dev/null +++ b/irc/unreal/files/patch-res.c @@ -0,0 +1,104 @@ +--- src/res.c 2006-09-19 15:45:18.000000000 +0300 ++++ src/res.c 2009-06-17 17:50:18.000000000 +0300 +@@ -48,10 +48,15 @@ + + #include <res.h> + ++/* Prevent crashes due to invalid prototype/ABI */ ++#if ARES_VERSION < 0x010600 ++ #error "You have an old c-ares version on your system and/or Unreals c-ares failed to compile!" ++#endif ++ + /* Forward declerations */ +-void unrealdns_cb_iptoname(void *arg, int status, struct hostent *he); +-void unrealdns_cb_nametoip_verify(void *arg, int status, struct hostent *he); +-void unrealdns_cb_nametoip_link(void *arg, int status, struct hostent *he); ++void unrealdns_cb_iptoname(void *arg, int status, int timeouts, struct hostent *he); ++void unrealdns_cb_nametoip_verify(void *arg, int status, int timeouts, struct hostent *he); ++void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct hostent *he); + void unrealdns_delasyncconnects(void); + static unsigned int unrealdns_haship(void *binaryip, int length); + static void unrealdns_addtocache(char *name, void *binaryip, int length); +@@ -240,7 +245,7 @@ + #endif + } + +-void unrealdns_cb_iptoname(void *arg, int status, struct hostent *he) ++void unrealdns_cb_iptoname(void *arg, int status, int timeouts, struct hostent *he) + { + DNSReq *r = (DNSReq *)arg; + DNSReq *newr; +@@ -290,7 +295,7 @@ + } + + +-void unrealdns_cb_nametoip_verify(void *arg, int status, struct hostent *he) ++void unrealdns_cb_nametoip_verify(void *arg, int status, int timeouts, struct hostent *he) + { + DNSReq *r = (DNSReq *)arg; + aClient *acptr = r->cptr; +@@ -363,7 +368,7 @@ + unrealdns_freeandremovereq(r); + } + +-void unrealdns_cb_nametoip_link(void *arg, int status, struct hostent *he) ++void unrealdns_cb_nametoip_link(void *arg, int status, int timeouts, struct hostent *he) + { + DNSReq *r = (DNSReq *)arg; + int n; +@@ -390,9 +395,11 @@ + /* fatal error while resolving */ + sendto_realops("Unable to resolve hostname '%s', when trying to connect to server %s.", + r->name, r->linkblock->servername); ++ r->linkblock->refcount--; + unrealdns_freeandremovereq(r); + return; + } ++ r->linkblock->refcount--; + + #ifdef INET6 + if (((he->h_length != 4) && (he->h_length != 16)) || !he->h_addr_list[0]) +@@ -715,21 +722,34 @@ + } else + if (*param == 'i') /* INFORMATION */ + { +- struct ares_config_info inf; ++ struct ares_options inf; + int i; ++ int optmask; + +- ares_get_config(&inf, resolver_channel); ++ ares_save_options(resolver_channel, &inf, &optmask); + + sendtxtnumeric(sptr, "****** DNS Configuration Information ******"); + sendtxtnumeric(sptr, " c-ares version: %s",ares_version(NULL)); +- sendtxtnumeric(sptr, " timeout: %d", inf.timeout); +- sendtxtnumeric(sptr, " tries: %d", inf.tries); +- sendtxtnumeric(sptr, " # of servers: %d", inf.numservers); +- for (i = 0; i < inf.numservers; i++) +- sendtxtnumeric(sptr, " server #%d: %s", i+1, inf.servers[i] ? inf.servers[i] : "[???]"); +- +- /* TODO: free or get memleak ! */ ++ ++ if(optmask & ARES_OPT_TIMEOUTMS) ++ sendtxtnumeric(sptr, " timeout: %d", inf.timeout); ++ if(optmask & ARES_OPT_TRIES) ++ sendtxtnumeric(sptr, " tries: %d", inf.tries); ++ if(optmask & ARES_OPT_SERVERS) ++ { ++ sendtxtnumeric(sptr, " # of servers: %d", inf.nservers); ++ for (i = 0; i < inf.nservers; i++) ++ sendtxtnumeric(sptr, " server #%d: %s", i+1, inet_ntoa(inf.servers[i])); ++ } ++ if(optmask & ARES_OPT_DOMAINS) ++ { ++ sendtxtnumeric(sptr, " # of search domains: %d", inf.ndomains); ++ for (i = 0; i < inf.ndomains; i++) ++ sendtxtnumeric(sptr, " domain #%d: %s", i+1, inf.domains[i]); ++ } + sendtxtnumeric(sptr, "****** End of DNS Configuration Info ******"); ++ ++ ares_destroy_options(&inf); + } else /* STATISTICS */ + { + sendtxtnumeric(sptr, "DNS CACHE Stats:"); |