aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxs <wxs@FreeBSD.org>2008-06-09 02:36:09 +0800
committerwxs <wxs@FreeBSD.org>2008-06-09 02:36:09 +0800
commit3e16950e95dcd4897cdc169b562adb8ea4093178 (patch)
tree1c86da091134559db157778a9e5bd8cfaf946070
parent45dd05c644f909993ec583a04bd06136ccee6f5e (diff)
downloadfreebsd-ports-gnome-3e16950e95dcd4897cdc169b562adb8ea4093178.tar.gz
freebsd-ports-gnome-3e16950e95dcd4897cdc169b562adb8ea4093178.tar.zst
freebsd-ports-gnome-3e16950e95dcd4897cdc169b562adb8ea4093178.zip
Fix opendbx backend bugs.
Bump PORTREVISION. PR: ports/124163 Submitted by: Ralf van der Enden <tremere@cainites.net> (maintainer) Approved by: garga (mentor, implicit)
-rw-r--r--dns/powerdns-devel/Makefile2
-rw-r--r--dns/powerdns-devel/files/patch-opendbx41
2 files changed, 42 insertions, 1 deletions
diff --git a/dns/powerdns-devel/Makefile b/dns/powerdns-devel/Makefile
index 0d5fb8284d29..e31a77c46874 100644
--- a/dns/powerdns-devel/Makefile
+++ b/dns/powerdns-devel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= powerdns
PORTVERSION= 3.0.${SNAPSHOT}
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= dns ipv6
MASTER_SITES= http://svn.powerdns.com/snapshots/${REVISION}/
PKGNAMESUFFIX= -devel
diff --git a/dns/powerdns-devel/files/patch-opendbx b/dns/powerdns-devel/files/patch-opendbx
new file mode 100644
index 000000000000..382f711c6286
--- /dev/null
+++ b/dns/powerdns-devel/files/patch-opendbx
@@ -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 )