]> granicus.if.org Git - pdns/commitdiff
fix david g's bug one level up as well - we used to do the wrong thing with truncated...
authorBert Hubert <bert.hubert@netherlabs.nl>
Sat, 22 Apr 2006 15:30:35 +0000 (15:30 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sat, 22 Apr 2006 15:30:35 +0000 (15:30 +0000)
change version to 3.0.1-snapshot

git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@761 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/config-recursor.h
pdns/dist-recursor
pdns/dnsparser.cc
pdns/dnsscan.cc
pdns/docs/pdns.sgml
pdns/pdns-recursor.spec

index 1d0dac2717b3bf5f6a44171a40f3eb94169c367f..73bdfe2f1257aa665bbde63094efebde4b52b146 100644 (file)
@@ -1,5 +1,5 @@
 #define SYSCONFDIR "/etc/powerdns/" 
 #define LOCALSTATEDIR "/var/run/" 
-#define VERSION "3.0"
+#define VERSION "3.0.1-snapshot"
 #define RECURSOR
 #define GCC_SKIP_LOCKING
index c08b28d3365cfff3bfc575f3bd890a4503b3ea25..d1c5dcdcfd340e1c5ed6bc59f6ffe7d121579b2c 100755 (executable)
@@ -1,4 +1,4 @@
-VERSION=3.0
+VERSION=3.0.1-snapshot
 
 INCLUDES="iputils.hh arguments.hh base64.hh zoneparser-tng.hh \
 rcpgenerator.hh lock.hh dnswriter.hh  dnsrecords.hh dnsparser.hh utility.hh \
index 17a122289c50728ac370c4c9ef06fbcc765f3576..6e778e10dcc3ba8abdaba0171e07cee41a41e713 100644 (file)
@@ -188,7 +188,7 @@ void MOADNSParser::init(const char *packet, unsigned int len)
   d_content.resize(contentlen);
   copy(packet+sizeof(dnsheader), packet+len, d_content.begin());
   
-  unsigned int n;
+  unsigned int n=0;
 
   PacketReader pr(d_content);
   bool validPacket=false;
@@ -234,10 +234,22 @@ void MOADNSParser::init(const char *packet, unsigned int len)
 #endif 
   }
   catch(out_of_range &re) {
-    if(!(validPacket && d_header.tc)) // don't sweat it over truncated packets
+    if(validPacket && d_header.tc) { // don't sweat it over truncated packets, but do adjust an, ns and arcount
+      if(n < d_header.ancount) {
+       d_header.ancount=n; d_header.nscount = d_header.arcount = 0;
+      }
+      else if(n < d_header.ancount + d_header.nscount) {
+       d_header.nscount = n - d_header.ancount; d_header.arcount=0;
+      }
+      else {
+       d_header.arcount = n - d_header.ancount - d_header.nscount;
+      }
+    }
+    else {
       throw MOADNSException("Error parsing packet of "+lexical_cast<string>(len)+" bytes (rd="+
                            lexical_cast<string>(d_header.rd)+
                            "), out of bounds: "+string(re.what()));
+    }
   }
 }
 
index 6431ab6495efabe611404e0c601bc871f3691811..26191eab2d5e238dd4927294f0380ecb55fad91f 100644 (file)
@@ -38,8 +38,8 @@ try
       MOADNSParser mdp((const char*)pr.d_payload, pr.d_len);
       for(int i=0; i < mdp.d_qname.length(); ++i)
        if(!isalnum(mdp.d_qname[i]) && mdp.d_qname[i]!='.' && mdp.d_qname[i]!='-' && mdp.d_qname[i]!='_') {
-         cout<<mdp.d_qname<<"|"<<mdp.d_qtype<<"|"<<mdp.d_qclass<<"\n";
-         sock.sendTo(string(pr.d_payload, pr.d_payload + pr.d_len), remote);
+         //      cout<<mdp.d_qname<<"|"<<mdp.d_qtype<<"|"<<mdp.d_qclass<<"\n";
+         // sock.sendTo(string(pr.d_payload, pr.d_payload + pr.d_len), remote);
          break;
        }
       if(mdp.d_qtype > 256 || mdp.d_qclass!=1 ) {
@@ -52,13 +52,13 @@ try
 
     }
     catch(MOADNSException &e) {
-      cerr<<"Error: "<<e.what()<<"\n";
+      cout<<"Error: "<<e.what()<<"\n";
       sock.sendTo(string(pr.d_payload, pr.d_payload + pr.d_len), remote);
     }
   }
 }
 catch(exception& e)
 {
-  cerr<<"Fatal: "<<e.what()<<endl;
+  cout<<"Fatal: "<<e.what()<<endl;
 }
 
index 6ae288eacc8527de9a1ee096b8e7ce84f87bcc81..c3464eb6ac3b89a2b49e1908436bc14be9ea0bdb 100644 (file)
@@ -8502,12 +8502,22 @@ GRANT ALL ON domains TO pdns;
 GRANT ALL ON records TO pdns;
          </programlisting>
        </para>
+       <para>
+         Zone2sql with the --gmysql flag also assumes this layout is in place.
+       </para>
        <para>
          This schema contains all elements needed for master, slave and superslave operation. Depending on which features will be used, the 'GRANT' statements
          can be trimmed to make sure PDNS cannot subvert the contents of your database.
        </para>
        <para>
-         Zone2sql with the --gmysql flag also assumes this layout is in place.
+         When using the InnoDB storage engine, we suggest adding the following lines to the 'create table records' command above:
+<programlisting>
+CONSTRAINT `records_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `domains`
+(`id`) ON DELETE CASCADE
+</programlisting>
+       </para>
+       <para>
+         This automates deletion of records on deletion of a domain from the domains table.
        </para>
       </sect2>
       <sect2><title>PostgresSQL specifics</title>
index 9d3c2c5f2ae7eaf26eec8088aa806a424e3e6309..67deb8ff0ab00b23de8b9bc020795de6637017b3 100644 (file)
@@ -2,7 +2,7 @@
 
 Buildroot: /tmp/pdns/
 Name: pdns-recursor
-Version: 3.0
+Version: 3.0.1snapshot
 Release: 1
 Summary: extremely powerful and versatile recursing nameserver
 Copyright: see /usr/doc/pdns/copyright