~ubuntu-branches/ubuntu/maverick/pdns/maverick-updates

« back to all changes in this revision

Viewing changes to debian/patches/update-geobackend.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Mohlmann, Matthijs Mohlmann, Christoph Haas
  • Date: 2007-04-15 23:23:39 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070415232339-5x3scc8gx04e50um
Tags: 2.9.21-1
[ Matthijs Mohlmann ]
* New upstream release. (Closes: #420294)
* Remove meta pdns package.
* Added new sqlite3 backend package.
* Months and minutes where mixed up. (Closes: #406462)
* Case sensitivity in bind backend caused PowerDNS to not serve a certain
  zone. (Closes: #406461)
* Bind backend forgot about zones on a notify. (Closes: #398213)

[ Christoph Haas ]
* Documented incorporated backend bind. (Closes: #415471)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## update-geobackend.dpatch by Matthijs Mohlmann <matthijs@cacholong.nl>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: No description.
6
 
 
7
 
@DPATCH@
8
 
diff -urNad trunk~/modules/geobackend/geobackend.cc trunk/modules/geobackend/geobackend.cc
9
 
--- trunk~/modules/geobackend/geobackend.cc     2005-11-01 13:10:44.000000000 +0100
10
 
+++ trunk/modules/geobackend/geobackend.cc      2006-08-13 23:15:30.326980528 +0200
11
 
@@ -79,8 +79,8 @@
12
 
        }
13
 
 }
14
 
 
15
 
-bool GeoBackend::getSOA(const string &name, SOAData &soadata) {
16
 
-       if (toLower(name) != toLower(zoneName))
17
 
+bool GeoBackend::getSOA(const string &name, SOAData &soadata, DNSPacket *p) {
18
 
+       if (toLower(name) != toLower(zoneName) || soaMasterServer.empty() || soaHostmaster.empty())
19
 
                return false;
20
 
        
21
 
        soadata.nameserver = soaMasterServer;
22
 
@@ -229,6 +229,8 @@
23
 
 }
24
 
 
25
 
 void GeoBackend::queueNSRecords(const string &qname) {
26
 
+       // nsRecords may be empty, e.g. when used in overlay mode
27
 
+
28
 
        for (vector<string>::const_iterator i = nsRecords.begin(); i != nsRecords.end(); ++i) {
29
 
                DNSResourceRecord *rr = new DNSResourceRecord;
30
 
                rr->qtype = QType::NS;
31
 
@@ -293,6 +295,10 @@
32
 
        vector<string> values;
33
 
        stringtok(values, getArg("soa-values"), " ,");
34
 
        
35
 
+       if (values.empty())
36
 
+               // No SOA values, probably no SOA record wanted because of overlay mode
37
 
+               return;
38
 
+
39
 
        if (values.size() != 2)
40
 
                throw AhuException("Invalid number of soa-values specified in configuration");
41
 
        
42
 
@@ -302,9 +308,6 @@
43
 
 
44
 
 void GeoBackend::loadNSRecords() {
45
 
        stringtok(nsRecords, getArg("ns-records"), " ,");
46
 
-       
47
 
-       if (nsRecords.empty())
48
 
-               throw AhuException("No NS records specified in configuration");
49
 
 }
50
 
 
51
 
 void GeoBackend::loadIPLocationMap() {
52
 
@@ -423,10 +426,14 @@
53
 
                                        string filename(*i);
54
 
                                        if (filename[filename.size()-1] != '/')
55
 
                                                filename += '/';
56
 
+
57
 
+                                       if (dent->d_name[0] == '.')
58
 
+                                               continue;       // skip filenames starting with a dot
59
 
+
60
 
                                        filename += dent->d_name;
61
 
                                        
62
 
                                        if (stat(filename.c_str(), &stbuf) != 0 || !S_ISREG(stbuf.st_mode))
63
 
-                                               continue;
64
 
+                                               continue;       // skip everything but regular files
65
 
                                                
66
 
                                        GeoRecord *gr = new GeoRecord;
67
 
                                        gr->directorfile = filename;
68
 
@@ -484,8 +491,8 @@
69
 
        while(getline(ifs, line)) {
70
 
                chomp(line, " \t");     // Erase whitespace
71
 
 
72
 
-               if (line[0] == '#')
73
 
-                       continue;       // Skip comments
74
 
+               if (line.empty() || line[0] == '#')
75
 
+                       continue;       // Skip empty lines and comments
76
 
        
77
 
                // Parse $RECORD
78
 
                if (line.substr(0, 7) == "$RECORD") {
79
 
diff -urNad trunk~/modules/geobackend/geobackend.hh trunk/modules/geobackend/geobackend.hh
80
 
--- trunk~/modules/geobackend/geobackend.hh     2005-11-01 13:10:43.000000000 +0100
81
 
+++ trunk/modules/geobackend/geobackend.hh      2006-08-13 23:15:46.882463712 +0200
82
 
@@ -36,7 +36,7 @@
83
 
        virtual void lookup(const QType &qtype, const string &qdomain, DNSPacket *pkt_p=0, int zoneId=-1);
84
 
        virtual bool list(const string &target, int domain_id);
85
 
        virtual bool get(DNSResourceRecord &r);
86
 
-       virtual bool getSOA(const string &name, SOAData &soadata);
87
 
+       virtual bool getSOA(const string &name, SOAData &soadata, DNSPacket *p=0);
88
 
        
89
 
        virtual void reload();
90
 
        virtual void rediscover(string *status = 0);