Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 May 2008 13:46:17 +0200
From:      Ralf van der Enden <tremere@cainites.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/124163: [PATCH] dns/powerdns-devel: Fix opendbx backend bugs
Message-ID:  <E1K2PXN-000JTW-Q6@cainites.net>
Resent-Message-ID: <200805311150.m4VBo4U9096867@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         124163
>Category:       ports
>Synopsis:       [PATCH] dns/powerdns-devel: Fix opendbx backend bugs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 31 11:50:04 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Ralf van der Enden
>Release:        FreeBSD 7.0-RELEASE-p1 i386
>Organization:
>Environment:
System: FreeBSD lan.cainites.net 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #1: Thu Apr 17 10:42:59 CEST 2008
>Description:
Fix opendbx backend bugs:
- Improves the compatibility of the SQL statements and fixes a bug in the getSOA() method (ttl was a random value).

Added file(s):
- files/patch-opendbx

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

--- powerdns-devel-3.0.20080406_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/dns/powerdns-devel/Makefile /usr/ports/dns/powerdns-devel.new/Makefile
--- /usr/ports/dns/powerdns-devel/Makefile	2008-05-07 14:40:00.000000000 +0200
+++ /usr/ports/dns/powerdns-devel.new/Makefile	2008-05-31 13:37:27.000000000 +0200
@@ -7,6 +7,7 @@
 
 PORTNAME=	powerdns
 PORTVERSION=	3.0.${SNAPSHOT}
+PORTREVISION=	1
 CATEGORIES=	dns ipv6
 MASTER_SITES=	http://svn.powerdns.com/snapshots/${REVISION}/
 PKGNAMESUFFIX=	-devel
diff -ruN --exclude=CVS /usr/ports/dns/powerdns-devel/files/patch-opendbx /usr/ports/dns/powerdns-devel.new/files/patch-opendbx
--- /usr/ports/dns/powerdns-devel/files/patch-opendbx	1970-01-01 01:00:00.000000000 +0100
+++ /usr/ports/dns/powerdns-devel.new/files/patch-opendbx	2008-05-31 13:37:27.000000000 +0200
@@ -0,0 +1,41 @@
+--- modules/opendbxbackend/odbxbackend.hh (revision 1154)
++++ modules/opendbxbackend/odbxbackend.hh (revision 1181)
+@@ -124,7 +124,7 @@
+		declare( suffix, "sql-lookuptype", "Lookup query with type","SELECT r.\"domain_id\", r.\"name\", r.\"type\", r.\"ttl\", r.\"prio\", r.\"content\" FROM \"records\" r WHERE r.\"name\"=':name' AND r.\"type\"=':type'" );
+		declare( suffix, "sql-lookuptypeid", "Lookup query with type and id","SELECT r.\"domain_id\", r.\"name\", r.\"type\", r.\"ttl\", r.\"prio\", r.\"content\" FROM \"records\" r WHERE r.\"domain_id\"=:id AND r.\"name\"=':name' AND r.\"type\"=':type'" );
+-		declare( suffix, "sql-lookupsoa","Lookup query for SOA record","SELECT d.\"id\", d.\"auto_serial\", r.\"content\" FROM \"records\" r JOIN \"domains\" d ON r.\"domain_id\"=d.\"id\" WHERE r.\"name\"=':name' AND r.\"type\"='SOA' AND d.\"status\"='A'" );
++		declare( suffix, "sql-lookupsoa","Lookup query for SOA record","SELECT d.\"id\", d.\"auto_serial\", r.\"ttl\", r.\"content\" FROM \"records\" r JOIN \"domains\" d ON r.\"domain_id\"=d.\"id\" WHERE r.\"name\"=':name' AND r.\"type\"='SOA' AND d.\"status\"='A'" );
+
+-		declare( suffix, "sql-zonedelete","Delete all records for this zone","DELETE FROM \"records\" r WHERE r.\"domain_id\"=:id" );
++		declare( suffix, "sql-zonedelete","Delete all records for this zone","DELETE FROM \"records\" WHERE \"domain_id\"=:id" );
+		declare( suffix, "sql-zoneinfo","Get domain info","SELECT d.\"id\", d.\"name\", d.\"type\", d.\"master\", d.\"last_check\", d.\"auto_serial\", r.\"content\" FROM \"domains\" d LEFT JOIN \"records\" r ON ( d.\"id\"=r.\"domain_id\" AND r.\"type\"='SOA' ) WHERE d.\"name\"=':name' AND d.\"status\"='A'" );
+
+@@ -136,6 +136,6 @@
+		declare( suffix, "sql-insert-record","Feed record into table", "INSERT INTO \"records\" ( \"domain_id\", \"name\", \"type\", \"ttl\", \"prio\", \"content\" ) VALUES ( %d, '%s', '%s', %d, %d, '%s' )" );
+
+-		declare( suffix, "sql-update-serial", "Set zone to notified", "UPDATE \"domains\" d SET d.\"notified_serial\"=%d WHERE d.\"id\"=%d" );
+-		declare( suffix, "sql-update-lastcheck", "Set time of last check", "UPDATE \"domains\" d SET d.\"last_check\"=%d WHERE d.\"id\"=%d" );
++		declare( suffix, "sql-update-serial", "Set zone to notified", "UPDATE \"domains\" SET \"notified_serial\"=%d WHERE \"id\"=%d" );
++		declare( suffix, "sql-update-lastcheck", "Set time of last check", "UPDATE \"domains\" SET \"last_check\"=%d WHERE \"id\"=%d" );
+
+		declare( suffix, "sql-master", "Get master record for zone", "SELECT d.\"master\" FROM \"domains\" d WHERE d.\"name\"=':name' AND d.\"status\"='A' AND d.\"type\"='SLAVE'" );
+--- modules/opendbxbackend/odbxbackend.cc (revision 1154)
++++ modules/opendbxbackend/odbxbackend.cc (revision 1181)
+@@ -185,9 +185,15 @@
+		{
+			sd.serial = 0;
++			sd.ttl = m_default_ttl;
++
++			if( ( tmp = odbx_field_value( m_result, 3 ) ) != NULL )
++			{
++				fillSOAData( string( tmp, odbx_field_length( m_result, 3 ) ), sd );
++			}
+
+			if( ( tmp = odbx_field_value( m_result, 2 ) ) != NULL )
+			{
+-				fillSOAData( string( tmp, odbx_field_length( m_result, 2 ) ), sd );
+-			}
++				sd.ttl = strtoul( tmp, NULL, 10 );
++			}
+
+			if( sd.serial == 0 && ( tmp = odbx_field_value( m_result, 1 ) ) != NULL )
--- powerdns-devel-3.0.20080406_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1K2PXN-000JTW-Q6>