diff options
author | tron <tron@pkgsrc.org> | 2007-05-29 09:03:12 +0000 |
---|---|---|
committer | tron <tron@pkgsrc.org> | 2007-05-29 09:03:12 +0000 |
commit | 95fbeb7c7be23e43ec47f8f1bda169990aed677d (patch) | |
tree | a4931a3ed52814cb0894008954c35a175bf9c2bc | |
parent | dbb19e2c00b5b05a88cf99ad677e4176c4aa54f9 (diff) | |
download | pkgsrc-95fbeb7c7be23e43ec47f8f1bda169990aed677d.tar.gz |
Teach "analog" about IPv6 addresses in webserver logfiles.
Bump package revision because of this new feature.
-rw-r--r-- | www/analog/Makefile | 3 | ||||
-rw-r--r-- | www/analog/distinfo | 3 | ||||
-rw-r--r-- | www/analog/patches/patch-ac | 74 |
3 files changed, 78 insertions, 2 deletions
diff --git a/www/analog/Makefile b/www/analog/Makefile index 2d0b630473b..4362aff0f99 100644 --- a/www/analog/Makefile +++ b/www/analog/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.55 2007/02/22 19:27:18 wiz Exp $ +# $NetBSD: Makefile,v 1.56 2007/05/29 09:03:12 tron Exp $ DISTNAME= analog-6.0 +PKGREVISION= 1 CATEGORIES= www MASTER_SITES= ${HOMEPAGE} \ http://www.web42.com/analog/ \ diff --git a/www/analog/distinfo b/www/analog/distinfo index dd167afb7bb..7f312d6a71d 100644 --- a/www/analog/distinfo +++ b/www/analog/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.21 2005/08/25 10:09:48 grant Exp $ +$NetBSD: distinfo,v 1.22 2007/05/29 09:03:13 tron Exp $ SHA1 (analog-6.0.tar.gz) = 17ad601f84e73c940883fb9b9e805879aac37493 RMD160 (analog-6.0.tar.gz) = 75c6157d2ac1459ee28a90001787382f5b671dca Size (analog-6.0.tar.gz) = 1553316 bytes SHA1 (patch-aa) = dc65dc097131572251f6e1490e3336c21ee53ee7 SHA1 (patch-ab) = e59f91bedf08f4ece6b36ee06bc8d7d7742948c4 +SHA1 (patch-ac) = 590016795c621ce76b84f7c17a91d36f8a980e50 diff --git a/www/analog/patches/patch-ac b/www/analog/patches/patch-ac new file mode 100644 index 00000000000..42b121173cf --- /dev/null +++ b/www/analog/patches/patch-ac @@ -0,0 +1,74 @@ +$NetBSD: patch-ac,v 1.5 2007/05/29 09:03:13 tron Exp $ + +--- alias.c.orig 2004-12-19 13:51:30.000000000 +0000 ++++ alias.c 2007-05-29 08:58:48.000000000 +0100 +@@ -13,6 +13,10 @@ + + #include "anlghea3.h" + ++#if defined(NI_MAXHOST) && defined(AI_NUMERICHOST) && defined(NI_NAMEREQD) ++#define IPV6 1 ++#endif ++ + /* Throughout this file, to avoid a buffer overflow, we must be careful when we + do any operation which can increase the length of the name. Such operations + are thankfully rare, except for user aliases in wildalias(). +@@ -213,7 +217,12 @@ + /* DNS lookup */ + + #ifndef NODNS ++#ifdef IPV6 ++ if (dnslevel != DNS_NONE && ++ (ISDIGIT(name[len]) || strchr(name, ':') != NULL)) { ++#else + if (dnslevel != DNS_NONE && ISDIGIT(name[len])) { ++#endif + do_dns(name, NULL, dnslevel); + len = (int)strlen(name) - 1; + } +@@ -605,6 +614,37 @@ + done = IpAddr2Name(name); + /* Doesn't currently include code to use SIGALRM */ + #else ++#ifdef IPV6 ++ struct addrinfo hints, *res; ++ char host[NI_MAXHOST]; ++ ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_flags = AI_NUMERICHOST; ++ res = NULL; ++#ifndef NOALARM ++ if (SETJMP(jumpbuf)) ++ signal(SIGALRM, SIG_DFL); ++ /* reset to default handling in case SIGALRM is raised exogenously */ ++ else { ++ signal(SIGALRM, sighandler); ++ alarm(dnstimeout); ++#endif ++ if (getaddrinfo(name, NULL, &hints, &res) == 0 && res != NULL) { ++ if (res->ai_addr != NULL && res->ai_addrlen > 0 && ++ getnameinfo(res->ai_addr, res->ai_addrlen, host, sizeof(host), ++ NULL, 0, NI_NAMEREQD) == 0) { ++ strncpy(name, host, BLOCKSIZE - 1); ++ name[BLOCKSIZE - 1] = '\0'; ++ done = TRUE; ++ } ++ freeaddrinfo(res); ++ } ++#ifndef NOALARM ++ alarm(0); ++ signal(SIGALRM, SIG_DFL); ++ } ++#endif ++#else + addr = inet_addr(name); + if (addr != INET_ADDR_ERR) { + addrp = (char *) &addr; +@@ -631,6 +671,7 @@ + } + #endif + } ++#endif /* not IPV6 */ + #endif /* not MAC */ + if (done) + debug('D', " resolved to %s", name); |