diff options
author | tron <tron> | 2007-05-29 09:03:12 +0000 |
---|---|---|
committer | tron <tron> | 2007-05-29 09:03:12 +0000 |
commit | 75a1b73f7eb70d2cc09fdb2e4bb18b821a8137f0 (patch) | |
tree | a4931a3ed52814cb0894008954c35a175bf9c2bc /www/analog | |
parent | 85747833ab7d5a9565bfceb5a0beb990023030a5 (diff) | |
download | pkgsrc-75a1b73f7eb70d2cc09fdb2e4bb18b821a8137f0.tar.gz |
Teach "analog" about IPv6 addresses in webserver logfiles.
Bump package revision because of this new feature.
Diffstat (limited to 'www/analog')
-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); |