From rafan@svm.csie.ntu.edu.tw  Wed Aug  8 08:06:45 2007
Return-Path: <rafan@svm.csie.ntu.edu.tw>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 939A216A46C
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  8 Aug 2007 08:06:45 +0000 (UTC)
	(envelope-from rafan@svm.csie.ntu.edu.tw)
Received: from svm.csie.ntu.edu.tw (svm.csie.ntu.edu.tw [140.112.90.75])
	by mx1.freebsd.org (Postfix) with ESMTP id 3772A13C465
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  8 Aug 2007 08:06:44 +0000 (UTC)
	(envelope-from rafan@svm.csie.ntu.edu.tw)
Received: from svm.csie.ntu.edu.tw (localhost [127.0.0.1])
	by svm.csie.ntu.edu.tw (8.14.1/8.14.1) with ESMTP id l7886f5R011340;
	Wed, 8 Aug 2007 16:06:41 +0800 (CST)
	(envelope-from rafan@svm.csie.ntu.edu.tw)
Received: (from rafan@localhost)
	by svm.csie.ntu.edu.tw (8.14.1/8.14.1/Submit) id l7886fdS031750;
	Wed, 8 Aug 2007 16:06:41 +0800 (CST)
	(envelope-from rafan)
Message-Id: <200708080806.l7886fdS031750@svm.csie.ntu.edu.tw>
Date: Wed, 8 Aug 2007 16:06:41 +0800 (CST)
From: Rong-En Fan <rafan@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: farrokhi@freebsd.org
Subject: [PATCH] dns/adns: include cname chains patch
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         115297
>Category:       ports
>Synopsis:       [PATCH] dns/adns: include cname chains patch
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    farrokhi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 08 08:10:01 GMT 2007
>Closed-Date:    Tue Aug 21 01:34:15 GMT 2007
>Last-Modified:  Tue Aug 21 01:40:01 GMT 2007
>Originator:     Rong-En Fan
>Release:        FreeBSD 6.2-STABLE amd64
>Organization:
NTU CSIE
>Environment:
System: FreeBSD svm.csie.ntu.edu.tw 6.2-STABLE FreeBSD 6.2-STABLE #1: Sat Jul 14 14:31:49 CST 2007
>Description:
- Include a patch for chained CNAME.  I need this for a web crawler.

Obtained from: http://hugo.vulcano.cl/development/adns-cc

Added file(s):
- files/patch-cname-chains

Port maintainer (farrokhi@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- adns-1.4_1.patch begins here ---
Index: Makefile
===================================================================
RCS file: /big/freebsd-cvsup/ncvs/ports/dns/adns/Makefile,v
retrieving revision 1.19
diff -u -u -r1.19 Makefile
--- Makefile	8 Nov 2006 09:28:24 -0000	1.19
+++ Makefile	8 Aug 2007 08:05:17 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	adns
 PORTVERSION=	1.4
+PORTREVISION=	1
 CATEGORIES=	dns
 MASTER_SITES=	ftp://ftp.chiark.greenend.org.uk/users/ian/adns/ \
 		http://www.chiark.greenend.org.uk/~ian/adns/ftp/
Index: files/patch-cname-chains
===================================================================
RCS file: files/patch-cname-chains
diff -N files/patch-cname-chains
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-cname-chains	8 Aug 2007 08:05:17 -0000
@@ -0,0 +1,56 @@
+Index: src/query.c
+===================================================================
+--- src/query.c	(revision 14)
++++ src/query.c	(working copy)
+@@ -63,6 +63,10 @@
+ 
+   qu->cname_dgram= 0;
+   qu->cname_dglen= qu->cname_begin= 0;
++  /* Patch to allow CNAME chains */
++  /* Credits: Brad Spencer, see http://www.chiark.greenend.org.uk/pipermail/adns-discuss/2006/001161.html */
++  /* Allow CNAME chains up to some sane limit */
++  qu->cname_alias_hops_left = 10;
+ 
+   adns__vbuf_init(&qu->search_vb);
+   qu->search_origlen= qu->search_pos= qu->search_doneabs= 0;
+Index: src/internal.h
+===================================================================
+--- src/internal.h	(revision 14)
++++ src/internal.h	(working copy)
+@@ -231,6 +231,11 @@
+   int cname_dglen, cname_begin;
+   /* If non-0, has been allocated using . */
+ 
++  /* Patch to allow CNAME chains */
++  /* Credits: Brad Spencer, see http://www.chiark.greenend.org.uk/pipermail/adns-discuss/2006/001161.html */
++  int cname_alias_hops_left;
++  /* The number of cname alias hops we will allow */
++
+   vbuf search_vb;
+   int search_origlen, search_pos, search_doneabs;
+   /* Used by the searching algorithm.  The query domain in textual form
+Index: src/reply.c
+===================================================================
+--- src/reply.c	(revision 14)
++++ src/reply.c	(working copy)
+@@ -190,12 +190,17 @@
+       if (qu->flags & adns_qf_cname_forbid) {
+ 	adns__query_fail(qu,adns_s_prohibitedcname);
+ 	return;
+-      } else if (qu->cname_dgram) { /* Ignore second and subsequent CNAME(s) */
++      }
++
++    /* Patch to allow CNAME chains */
++    /* Credits: Brad Spencer, see http://www.chiark.greenend.org.uk/pipermail/adns-discuss/2006/001161.html */
++    else if (qu->cname_dgram && --(qu->cname_alias_hops_left) <= 0) { /* Don't follow "too long" CNAME chains */
+ 	adns__debug(ads,serv,qu,"allegedly canonical name %s"
+-		    " is actually alias for %s", qu->answer->cname,
++           " is actually alias for %s and aliases too deep",
++                    qu->answer->cname,
+ 		    adns__diag_domain(ads,serv,qu, &qu->vb,
+ 				      dgram,dglen,rdstart));
+-	adns__query_fail(qu,adns_s_prohibitedcname);
++    adns__query_fail(qu,adns_s_norecurse);
+ 	return;
+       } else if (wantedrrs) { /* Ignore CNAME(s) after RR(s). */
+ 	adns__debug(ads,serv,qu,"ignoring CNAME (to %s) coexisting with RR",
--- adns-1.4_1.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->farrokhi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Aug 8 08:10:10 UTC 2007 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115297 
State-Changed-From-To: open->closed 
State-Changed-By: rafan 
State-Changed-When: Tue Aug 21 01:34:14 UTC 2007 
State-Changed-Why:  
Committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115297 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/115297: commit references a PR
Date: Tue, 21 Aug 2007 01:34:02 +0000 (UTC)

 rafan       2007-08-21 01:33:57 UTC
 
   FreeBSD ports repository
 
   Modified files:
     dns/adns             Makefile 
   Added files:
     dns/adns/files       patch-cname-chains 
   Log:
   - Add a patch for chained CNAME
   
   PR:             ports/115297
   Submitted by:   rafan
   Approved by:    farrokhi (maintainer)
   Obtained from:  http://hugo.vulcano.cl/development/adns-cc
   
   Revision  Changes    Path
   1.20      +1 -0      ports/dns/adns/Makefile
   1.1       +56 -0     ports/dns/adns/files/patch-cname-chains (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
