pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/djbdns Add Russ Nelson's dnscache patch to ignore ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/868a8c95f07c
branches:  trunk
changeset: 461937:868a8c95f07c
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Wed Sep 24 03:28:12 2003 +0000

description:
Add Russ Nelson's dnscache patch to ignore IP addresses listed in
root/ignoreip, in response to Verisign's latest silliness. The
behavior of dnscache is unchanged unless you create this file. Bump
PKGREVISION.

While I'm here, change the "post-patch" target to "do-configure",
since that's what it's doing.

See <URL:http://tinydns.org/djbdns-1.05-ignoreip2.patch> for more
information about this patch.

diffstat:

 net/djbdns/Makefile         |   6 +++---
 net/djbdns/distinfo         |   4 +++-
 net/djbdns/patches/patch-ac |  42 ++++++++++++++++++++++++++++++++++++++++++
 net/djbdns/patches/patch-ad |  31 +++++++++++++++++++++++++++++++
 4 files changed, 79 insertions(+), 4 deletions(-)

diffs (120 lines):

diff -r 359715a265f1 -r 868a8c95f07c net/djbdns/Makefile
--- a/net/djbdns/Makefile       Wed Sep 24 03:01:02 2003 +0000
+++ b/net/djbdns/Makefile       Wed Sep 24 03:28:12 2003 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.26 2003/09/17 19:40:51 grant Exp $
+# $NetBSD: Makefile,v 1.27 2003/09/24 03:28:12 schmonz Exp $
 # FreeBSD Id: ports/net/djbdns/Makefile,v 1.4 2000/09/28 18:18:41 nbm Exp
 #
 
 DISTNAME=      djbdns-1.05
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    net
 MASTER_SITES=  http://cr.yp.to/djbdns/                                 \
                ftp://cr.yp.to/djbdns/                                  \
@@ -45,7 +45,7 @@
        @${CP} ${DISTDIR}/tinydns-log.pl.txt ${WRKSRC}/tinydns-log.pl
        @${CP} ${DISTDIR}/dnscache-log.pl.txt ${WRKSRC}/dnscache-log.pl
 
-post-patch:
+do-configure:
        ${ECHO} ${CC} ${CFLAGS} > ${WRKSRC}/conf-cc
        ${ECHO} ${CC} ${_STRIPFLAG_CC} > ${WRKSRC}/conf-ld
        ${ECHO} ${PREFIX} > ${WRKSRC}/conf-home
diff -r 359715a265f1 -r 868a8c95f07c net/djbdns/distinfo
--- a/net/djbdns/distinfo       Wed Sep 24 03:01:02 2003 +0000
+++ b/net/djbdns/distinfo       Wed Sep 24 03:28:12 2003 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.7 2003/03/29 21:55:19 salo Exp $
+$NetBSD: distinfo,v 1.8 2003/09/24 03:28:13 schmonz Exp $
 
 SHA1 (djbdns-1.05.tar.gz) = 2efdb3a039d0c548f40936aa9cb30829e0ce8c3d
 Size (djbdns-1.05.tar.gz) = 85648 bytes
@@ -12,3 +12,5 @@
 Size (djbdns-1.05-ipv6.diff.bz2) = 7306 bytes
 SHA1 (patch-aa) = 9b16d6a7fc2aec2483ca4c90100dc4bae92392fc
 SHA1 (patch-ab) = bd709644fbf55d67d5ad56beb5c545729432b727
+SHA1 (patch-ac) = 412a921af1bd0011c2355af648bcadc2645f9dcb
+SHA1 (patch-ad) = 85bf15f630c8c285175d490d9fe2ba8859279852
diff -r 359715a265f1 -r 868a8c95f07c net/djbdns/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns/patches/patch-ac       Wed Sep 24 03:28:12 2003 +0000
@@ -0,0 +1,42 @@
+$NetBSD: patch-ac,v 1.1 2003/09/24 03:28:14 schmonz Exp $
+
+--- dnscache.c.orig    Sun Feb 11 16:11:45 2001
++++ dnscache.c
+@@ -23,6 +23,8 @@
+ #include "okclient.h"
+ #include "droproot.h"
+ 
++stralloc ignoreip = {0};
++
+ static int packetquery(char *buf,unsigned int len,char **q,char qtype[2],char qclass[2],char id[2])
+ {
+   unsigned int pos;
+@@ -389,6 +391,7 @@ char seed[128];
+ int main()
+ {
+   char *x;
++  unsigned int i, j, k;
+   unsigned long cachesize;
+ 
+   x = env_get("IP");
+@@ -430,6 +433,20 @@ int main()
+   scan_ulong(x,&cachesize);
+   if (!cache_init(cachesize))
+     strerr_die3x(111,FATAL,"not enough memory for cache of size ",x);
++
++  if (openreadclose("ignoreip",&ignoreip,64) < 0) 
++    strerr_die2x(111,FATAL,"trouble reading ignoreip");
++  for(j = k = i = 0; i < ignoreip.len; i++)
++    if (ignoreip.s[i] == '\n')  {
++      ignoreip.s[i] = '\0';
++      if (j + 4 > i)
++        strerr_die3x(111,FATAL,"badly malformed ip4 address ",ignoreip.s+k);
++      if (!ip4_scan(ignoreip.s+k,ignoreip.s+j))
++        strerr_die3x(111,FATAL,"unable to parse address in ignoreip ",ignoreip.s+k);
++      j += 4;
++      k = i + 1;
++    }
++  ignoreip.len = j;
+ 
+   if (env_get("HIDETTL"))
+     response_hidettl();
diff -r 359715a265f1 -r 868a8c95f07c net/djbdns/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns/patches/patch-ad       Wed Sep 24 03:28:12 2003 +0000
@@ -0,0 +1,31 @@
+$NetBSD: patch-ad,v 1.1 2003/09/24 03:28:14 schmonz Exp $
+
+--- query.c.orig       Wed Sep 17 11:42:42 2003
++++ query.c
+@@ -13,6 +13,8 @@
+ #include "response.h"
+ #include "query.h"
+ 
++extern stralloc ignoreip;
++
+ static int flagforwardonly = 0;
+ 
+ void query_forwardonly(void)
+@@ -193,6 +195,7 @@ static int doit(struct query *z,int stat
+   int k;
+   int p;
+   int q;
++  unsigned int ii;
+ 
+   errno = error_io;
+   if (state == 1) goto HAVEPACKET;
+@@ -795,6 +798,9 @@ static int doit(struct query *z,int stat
+         pos = dns_packet_copy(buf,len,pos,header,10); if (!pos) goto DIE;
+         if (byte_equal(header + 8,2,"\0\4")) {
+           pos = dns_packet_copy(buf,len,pos,header,4); if (!pos) goto DIE;
++          if (ignoreip.len)
++          for(ii = 0; ii < ignoreip.len; ii+= 4)
++            if (byte_equal(header,4,ignoreip.s+ii)) goto NXDOMAIN;
+           save_data(header,4);
+           log_rr(whichserver,t1,DNS_T_A,header,4,ttl);
+         }



Home | Main Index | Thread Index | Old Index