Changeset 180
- Timestamp:
- 08/22/03 15:33:31 (10 years ago)
- Location:
- trunk/pdns
- Files:
-
- 31 modified
-
ChangeLog (modified) (1 diff)
-
debian/changelog (modified) (2 diffs)
-
debian/control (modified) (1 diff)
-
debian/rules (modified) (1 diff)
-
modules/ldapbackend/ldapbackend.cc (modified) (9 diffs)
-
modules/ldapbackend/ldapbackend.hh (modified) (3 diffs)
-
modules/mysqlbackend/mysqlcbackend.cc (modified) (2 diffs)
-
modules/mysqlbackend/mysqlcbackend.hh (modified) (1 diff)
-
modules/oraclebackend/oraclebackend.cc (modified) (2 diffs)
-
modules/oraclebackend/oraclebackend.hh (modified) (2 diffs)
-
modules/pdnsbackend/pdnsbackend.cc (modified) (2 diffs)
-
modules/pdnsbackend/pdnsbackend.hh (modified) (2 diffs)
-
modules/pipebackend/pipebackend.cc (modified) (2 diffs)
-
modules/pipebackend/pipebackend.hh (modified) (2 diffs)
-
modules/xdbbackend/xdbbackend.cc (modified) (1 diff)
-
pdns/backends/bind/bindbackend.cc (modified) (2 diffs)
-
pdns/backends/bind/bindbackend.hh (modified) (1 diff)
-
pdns/backends/bind/bindbackend2.cc (modified) (2 diffs)
-
pdns/backends/bind/bindbackend2.hh (modified) (1 diff)
-
pdns/backends/gsql/gsqlbackend.cc (modified) (3 diffs)
-
pdns/backends/gsql/gsqlbackend.hh (modified) (1 diff)
-
pdns/common_startup.cc (modified) (1 diff)
-
pdns/dnsbackend.cc (modified) (1 diff)
-
pdns/dnsbackend.hh (modified) (2 diffs)
-
pdns/packethandler.hh (modified) (1 diff)
-
pdns/pdns_recursor.cc (modified) (4 diffs)
-
pdns/randombackend.cc (modified) (1 diff)
-
pdns/receiver.cc (modified) (2 diffs)
-
pdns/tcpreceiver.cc (modified) (1 diff)
-
pdns/ueberbackend.cc (modified) (2 diffs)
-
pdns/ueberbackend.hh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/ChangeLog
r178 r180 1 1 changes since 2.9.10: 2 2 - pdns_recursor now cleans its cache 3 - pdns_recursor writes its pid to disk now (FreeBSD port maintainer) 3 4 - disable-axfr check was reversed (oops) 4 - LDAP now has infrastructure for AXFR (Norbert Sendetzky) 5 - LDAP now supports AXFR and a default TTL 6 - some debugging output messed up the working of pdns_control (Mark Bergsma) 7 - updates to axfr --help output (Norbert Sendetzky) 5 8 6 9 Changes since 2.9.8: -
trunk/pdns/debian/changelog
r178 r180 1 1 pdns (2.9.11-1) unstable; urgency=low 2 2 3 * fill in the blanks 3 * New upstream release 4 * Do not include zone2ldap in pdns package. Closes: Bug#198613 5 * The gdbm-dev seems to have changed its name, update Build-Depends 6 accordingly. Closes: Bug#199595 4 7 5 -- Wichert Akkerman <wakkerma@debian.org> Sat, 5 Jul 2003 20:16:16 +0100 6 7 pdns (2.9.10-1) unstable; urgency=low 8 9 * fill in the blanks 10 11 -- Wichert Akkerman <wakkerma@debian.org> Thu, 3 Jul 2003 20:16:16 +0100 12 13 pdns (2.9.9-1) unstable; urgency=low 14 15 * fill in the blanks 16 17 -- Wichert Akkerman <wakkerma@debian.org> Thu, 27 May 2003 20:16:16 +0100 18 8 -- Wichert Akkerman <wakkerma@debian.org> Mon, 14 Jul 2003 13:52:47 +0200 19 9 20 10 pdns (2.9.8-1) unstable; urgency=low 21 11 22 * fill in the blanks12 * New upstream release. Closes: Bug#187781 23 13 24 -- Wichert Akkerman <wakkerma@debian.org> Thu, 30 Apr 2003 20:16:16 +010014 -- Wichert Akkerman <wakkerma@debian.org> Mon, 5 May 2003 13:43:16 +0200 25 15 26 16 pdns (2.9.7-1) unstable; urgency=low 27 17 28 * fill in the blanks18 * New upstream release. Closes: Bug#185730 29 19 30 -- Wichert Akkerman <wakkerma@debian.org> Thu, 14 Mar 2003 20:16:16 +0100 20 -- Wichert Akkerman <wakkerma@debian.org> Fri, 21 Mar 2003 12:53:00 +0100 21 22 pdns (2.9.6-2) unstable; urgency=low 23 24 * Enable the recursing nameserver 25 * Change order of things in clean target so debian/files is properly 26 removed. Closes: Bug#181994 27 28 -- Wichert Akkerman <wakkerma@debian.org> Sun, 23 Feb 2003 12:34:57 +0100 31 29 32 30 pdns (2.9.6-1) unstable; urgency=low 33 31 34 * fill in the blanks32 * New upstream release, adding a new LDAP backend 35 33 36 -- Wichert Akkerman <wakkerma@debian.org> Fri, 14 Feb 2003 20:16:16 +0100 34 -- Wichert Akkerman <wakkerma@debian.org> Sun, 16 Feb 2003 14:49:08 +0100 35 37 36 38 37 pdns (2.9.5-1) unstable; urgency=low … … 89 88 90 89 -- Wichert Akkerman <wakkerma@debian.org> Sun, 1 Dec 2002 15:04:52 +0100 90 -
trunk/pdns/debian/control
r153 r180 4 4 Standards-Version: 3.5.8 5 5 Maintainer: Wichert Akkerman <wakkerma@debian.org> 6 Build-Depends: automake1.5, autoconf, libtool, flex, bison, docbook-utils, libmysqlclient10-dev, postgresql-dev, tdb-dev, libgdbm g1-dev, libpqpp-dev, libldap2-dev6 Build-Depends: automake1.5, autoconf, libtool, flex, bison, docbook-utils, libmysqlclient10-dev, postgresql-dev, tdb-dev, libgdbm-dev, libpqpp-dev, libldap2-dev 7 7 8 8 Package: pdns -
trunk/pdns/debian/rules
r175 r180 84 84 rm -f "$(tmpdir)"/usr/bin/binpatch 85 85 rm -f "$(tmpdir)"/usr/bin/xdb-fill 86 rm -f "$(tmpdir)"/usr/bin/zone2ldap 86 87 rm -rf "$(tmpdir)"/usr/lib 87 88 -
trunk/pdns/modules/ldapbackend/ldapbackend.cc
r176 r180 36 36 setArgPrefix( "ldap" + suffix ); 37 37 38 L << Logger::Notice << backendname << " LDAP Server = " << getArg( "host" ) << ":" << getArg( "port" ) << endl; 38 39 m_default_ttl = (u_int32_t) strtol( getArg( "default-ttl" ).c_str(), NULL, 10 ); 39 40 40 41 try 41 42 { 43 L << Logger::Info << backendname << " LDAP Server = " << getArg( "host" ) << ":" << getArg( "port" ) << endl; 42 44 m_pldap = new PowerLDAP( getArg( "host" ), (u_int16_t) atoi( getArg( "port" ).c_str() ) ); 43 45 m_pldap->simpleBind( getArg( "binddn" ), getArg( "secret" ) ); … … 50 52 } 51 53 52 L << Logger:: Notice<< backendname << " Ldap connection succeeded" << endl;54 L << Logger::Info << backendname << " Ldap connection succeeded" << endl; 53 55 } 54 56 … … 61 63 62 64 63 bool LdapBackend::list( int domain_id ) 64 { 65 L << Logger::Warning << backendname << " AXFR is not supported" << endl; 66 return false; 65 bool LdapBackend::list( const string &target, int domain_id ) 66 { 67 string filter, dn; 68 char* attributes[] = { "associatedDomain", NULL }; 69 70 71 try 72 { 73 L << Logger::Notice << backendname << " AXFR request for " << target << endl; 74 75 // search for DN of SOA record which is SOA for target zone 76 77 filter = "(&(associatedDomain=" + target + ")(SOARecord=*))"; 78 m_msgid = m_pldap->search( getArg("basedn"), LDAP_SCOPE_SUBTREE, filter, (const char**) attributes ); 79 80 if( m_pldap->getSearchEntry( m_msgid, m_result, true ) == false ) 81 { 82 L << Logger::Error << backendname << " Unable to get SOA record for " << target << endl; 83 return false; 84 } 85 86 if( m_result.empty() ) 87 { 88 L << Logger::Error << backendname << " No SOA record for " << target << endl; 89 return false; 90 } 91 92 if( m_result.find( "dn" ) == m_result.end() ) 93 { 94 L << Logger::Error << backendname << " LDAP error while searching SOA record for " << target << endl; 95 return false; 96 } 97 98 if( m_result["dn"].empty() ) 99 { 100 L << Logger::Error << backendname << " LDAP error while getting SOA record for " << target << endl; 101 return false; 102 } 103 104 dn = m_result["dn"].front(); 105 m_result.clear(); 106 107 // list all records one level below but not entries containing SOA records (these are seperate zones) 108 109 m_qname = ""; 110 m_adomain = m_adomains.end(); // skip loops in get() first time 111 filter = "(&(associatedDomain=*)(!(SOARecord=*)))"; 112 m_msgid = m_pldap->search( dn, LDAP_SCOPE_ONELEVEL, filter, (const char**) attrany ); 113 } 114 catch( LDAPException &le ) 115 { 116 L << Logger::Error << backendname << " Unable to get zone " + target + " from LDAP directory: " << le.what() << endl; 117 return false; 118 } 119 catch( exception &e ) 120 { 121 L << Logger::Error << backendname << " Caught STL exception: " << e.what() << endl; 122 return false; 123 } 124 catch( ... ) 125 { 126 L << Logger::Critical << backendname << " Caught unknown exception" << endl; 127 return false; 128 } 129 130 return true; 67 131 } 68 132 … … 73 137 vector<string> parts; 74 138 string filter, attr, qesc; 75 char** attributes = attrany ;139 char** attributes = attrany + 1; // skip associatedDomain 76 140 char* attronly[] = { NULL, "dNSTTL", NULL }; 77 141 … … 88 152 stringtok( parts, qesc, "." ); 89 153 90 if( len > 9 && ( qesc.substr( len - 9, 9 ) == ".ip6.arpa" || qesc.substr( len - 8, 8 ) == ".ip6.int" ) ) // IPv6 reverse lookups 154 if( len > 13 && qesc.substr( len - 13, 13 ) == ".in-addr.arpa" ) // IPv4 reverse lookups 155 { 156 parts.pop_back(); 157 parts.pop_back(); 158 159 filter = "(aRecord=" + parts.back(); 160 parts.pop_back(); 161 while( !parts.empty() ) 162 { 163 filter += "." + parts.back(); 164 parts.pop_back(); 165 } 166 filter += ")"; 167 168 attronly[0] = "associatedDomain"; 169 attributes = attronly; 170 } 171 else if( len > 9 && ( qesc.substr( len - 8, 8 ) == ".ip6.int" || qesc.substr( len - 9, 9 ) == ".ip6.arpa" ) ) // IPv6 reverse lookups 91 172 { 92 173 parts.pop_back(); … … 98 179 { 99 180 filter += ":" + parts.back(); 100 parts.pop_back();101 }102 filter += ")";103 104 attronly[0] = "associatedDomain";105 attributes = attronly;106 }107 else if( len > 13 && qesc.substr( len - 13, 13 ) == ".in-addr.arpa" ) // IPv4 reverse lookups108 {109 parts.pop_back();110 parts.pop_back();111 112 filter = "(aRecord=" + parts.back();113 parts.pop_back();114 while( !parts.empty() )115 {116 filter += "." + parts.back();117 181 parts.pop_back(); 118 182 } … … 146 210 } 147 211 212 m_adomain = m_adomains.end(); // skip loops in get() first time 148 213 L << Logger::Info << backendname << " Search = basedn: " << getArg( "basedn" ) << ", filter: " << filter << ", qtype: " << qtype.getName() << endl; 149 214 m_msgid = m_pldap->search( getArg("basedn"), LDAP_SCOPE_SUBTREE, filter, (const char**) attributes ); 150 215 } 151 catch( LDAPException &e ) 152 { 153 L << Logger::Warning << backendname << " Unable to search LDAP directory: " << e.what() << endl; 216 catch( LDAPException &le ) 217 { 218 L << Logger::Warning << backendname << " Unable to search LDAP directory: " << le.what() << endl; 219 return; 220 } 221 catch( exception &e ) 222 { 223 L << Logger::Error << backendname << " Caught STL exception: " << e.what() << endl; 154 224 return; 155 225 } … … 166 236 QType qt; 167 237 vector<string> parts; 168 vector<string> values;169 238 string attrname, content, qstr; 170 PowerLDAP::sentry_t::iterator attribute;171 239 172 240 173 241 try 174 242 { 175 176 Redo: 177 178 while( !m_result.empty() ) 179 { 180 attribute = m_result.begin(); 181 if( attribute != m_result.end() && !attribute->second.empty() ) 182 { 183 attrname = attribute->first; 184 qstr = attrname.substr( 0, attrname.length() - 6 ); // extract qtype string from ldap attribute name 185 transform( qstr.begin(), qstr.end(), qstr.begin(), &Toupper ); 186 qt = QType( const_cast<char*>(qstr.c_str()) ); 187 188 if( m_qtype.getCode() == QType::ANY || m_qtype.getCode() == qt.getCode() ) 243 do 244 { 245 do 246 { 247 while( m_adomain != m_adomains.end() ) 189 248 { 190 content = attribute->second.back(); 191 attribute->second.pop_back(); 192 193 rr.qtype = qt; 194 rr.qname = m_qname; 195 rr.priority = 0; 196 rr.ttl = m_ttl; 197 198 if( qt.getCode() == QType::MX ) // MX Record, e.g. 10 smtp.example.com 249 while( m_attribute != m_result.end() ) 199 250 { 200 parts.clear(); 201 stringtok( parts, content, " " ); 202 203 if( parts.size() != 2) 251 attrname = m_attribute->first; 252 qstr = attrname.substr( 0, attrname.length() - 6 ); // extract qtype string from ldap attribute name 253 transform( qstr.begin(), qstr.end(), qstr.begin(), &Toupper ); 254 qt = QType( const_cast<char*>(qstr.c_str()) ); 255 256 while( m_value != m_attribute->second.end() ) 204 257 { 205 L << Logger::Warning << backendname << " Invalid MX record without priority: " << content << endl; 206 goto Redo; 258 content = *m_value; 259 260 rr.qtype = qt; 261 rr.qname = *m_adomain; 262 rr.priority = 0; 263 rr.ttl = m_ttl; 264 265 if( qt.getCode() == QType::MX ) // MX Record, e.g. 10 smtp.example.com 266 { 267 parts.clear(); 268 stringtok( parts, content, " " ); 269 270 if( parts.size() != 2) 271 { 272 L << Logger::Warning << backendname << " Invalid MX record without priority: " << content << endl; 273 continue; 274 } 275 276 rr.priority = (u_int16_t) strtol( parts[0].c_str(), NULL, 10 ); 277 content = parts[1]; 278 } 279 280 rr.content = content; 281 m_value++; 282 283 L << Logger::Info << backendname << " Record = qname: " << rr.qname << ", qtype: " << (rr.qtype).getName() << ", priority: " << rr.priority << ", content: " << rr.content << endl; 284 return true; 207 285 } 208 286 209 rr.priority = (u_int16_t) strtol( parts[0].c_str(), NULL, 10 );210 content = parts[1];287 m_attribute++; 288 m_value = m_attribute->second.begin(); 211 289 } 212 rr.content = content; 213 214 L << Logger::Info << backendname << " Record = qname: " << rr.qname << ", qtype: " << (rr.qtype).getName() << ", priority: " << rr.priority << ", content: " << rr.content << endl; 215 return true; 290 m_adomain++; 291 m_attribute = m_result.begin(); 292 m_value = m_attribute->second.begin(); 216 293 } 217 294 } 218 m_result.erase( attribute ); 219 } 220 221 if( m_pldap->getSearchEntry( m_msgid, m_result ) == true ) 222 { 223 if( m_result.find( "dNSTTL" ) != m_result.end() && m_result["dNSTTL"].size() > 0 ) 224 { 225 m_ttl = (u_int32_t) strtol( m_result["dNSTTL"][0].c_str(), NULL, 10 ); 226 m_result.erase( "dNSTTL" ); 227 } 228 else 229 { 230 m_ttl = (u_int32_t) strtol( getArg( "default-ttl" ).c_str(), NULL, 10 ); 231 } 232 233 if( m_result.find( "associatedDomain" ) != m_result.end() ) 234 { 235 m_result["PTRRecord"] = m_result["associatedDomain"]; 236 m_result.erase( "associatedDomain" ); 237 } 238 239 goto Redo; 240 } 241 } 242 catch( LDAPException &e ) 243 { 244 L << Logger::Warning << backendname << " Search failed: " << e.what() << endl; 295 while( !m_adomains.empty() && m_qname.empty() && mustDo( "disable-ptrrecord" ) && makePtrRecords() ); // make PTR records from associatedDomain entries 296 297 m_result.clear(); 298 } 299 while( m_pldap->getSearchEntry( m_msgid, m_result, false ) && prepSearchEntry() ); 300 301 } 302 catch( LDAPException &le ) 303 { 304 L << Logger::Warning << backendname << " Search failed: " << le.what() << endl; 305 } 306 catch( exception &e ) 307 { 308 L << Logger::Error << backendname << " Caught STL exception: " << e.what() << endl; 245 309 } 246 310 catch( ... ) … … 250 314 251 315 return false; 316 } 317 318 319 inline bool LdapBackend::prepSearchEntry() 320 { 321 m_adomains.clear(); 322 m_ttl = m_default_ttl; 323 324 if( m_result.find( "dNSTTL" ) != m_result.end() && !m_result["dNSTTL"].empty() ) 325 { 326 m_ttl = (u_int32_t) strtol( m_result["dNSTTL"][0].c_str(), NULL, 10 ); 327 m_result.erase( "dNSTTL" ); 328 } 329 330 if( !m_qname.empty() ) // request was a normal lookup() 331 { 332 m_adomains.push_back( m_qname ); 333 if( m_result.find( "associatedDomain" ) != m_result.end() ) 334 { 335 m_result["PTRRecord"] = m_result["associatedDomain"]; 336 m_result.erase( "associatedDomain" ); 337 } 338 } 339 else // request was a list() for AXFR 340 { 341 if( m_result.find( "associatedDomain" ) != m_result.end() ) 342 { 343 m_adomains = m_result["associatedDomain"]; 344 m_result.erase( "associatedDomain" ); 345 } 346 } 347 348 m_adomain = m_adomains.begin(); 349 m_attribute = m_result.begin(); 350 m_value = m_attribute->second.begin(); 351 352 return true; 353 } 354 355 356 inline bool LdapBackend::makePtrRecords() 357 { 358 unsigned int i = 0; 359 string ptrsrc; 360 vector<string> parts, tmp; 361 vector<string>::iterator record; 362 char* attr[] = { "aRecord", "aAAARecord", NULL }; 363 char* suffix[] = { ".in-addr.arpa", ".ip6.int", NULL }; 364 char* seperator[] = { ".", ":", NULL }; 365 366 367 tmp = m_adomains; 368 m_adomains.clear(); 369 370 while( attr[i] != NULL && m_result.find( attr[i] ) != m_result.end() ) 371 { 372 for( record = m_result[attr[i]].begin(); record != m_result[attr[i]].end(); record++ ) 373 { 374 parts.clear(); 375 stringtok( parts, *record, seperator[i] ); 376 377 ptrsrc = parts.back(); 378 parts.pop_back(); 379 while( !parts.empty() ) 380 { 381 ptrsrc += "." + parts.back(); 382 parts.pop_back(); 383 } 384 ptrsrc += suffix[i]; 385 386 m_adomains.push_back( ptrsrc ); 387 } 388 389 i++; 390 } 391 392 if( m_adomains.empty() ) 393 { 394 return false; 395 } 396 397 m_result.clear(); 398 m_result["PTRRecord"] = tmp; 399 m_adomain = m_adomains.begin(); 400 m_attribute = m_result.begin(); 401 m_value = m_attribute->second.begin(); 402 403 return true; 252 404 } 253 405 -
trunk/pdns/modules/ldapbackend/ldapbackend.hh
r175 r180 49 49 50 50 static char* attrany[] = { 51 "associatedDomain", 51 52 "dNSTTL", 52 53 "aRecord", … … 73 74 int m_msgid; 74 75 u_int32_t m_ttl; 76 u_int32_t m_default_ttl; 75 77 QType m_qtype; 76 78 string m_qname; 77 79 PowerLDAP* m_pldap; 78 80 PowerLDAP::sentry_t m_result; 81 PowerLDAP::sentry_t::iterator m_attribute; 82 vector<string>::iterator m_value, m_adomain; 83 vector<string> m_adomains; 84 85 bool prepSearchEntry(); 86 bool makePtrRecords(); 79 87 80 88 public: … … 84 92 85 93 void lookup( const QType &qtype, const string &qdomain, DNSPacket *p=0, int zoneid=-1 ); 86 bool list( int domain_id );94 bool list( const string &target, int domain_id ); 87 95 bool get( DNSResourceRecord &rr ); 88 96 }; -
trunk/pdns/modules/mysqlbackend/mysqlcbackend.cc
r118 r180 1 // $Id: mysqlcbackend.cc,v 1. 3 2003/01/06 16:13:59ahu Exp $1 // $Id: mysqlcbackend.cc,v 1.4 2003/08/22 13:33:31 ahu Exp $ 2 2 #include <string> 3 3 #include <map> … … 104 104 } 105 105 106 bool MySQLBackend::list( int domain_id )106 bool MySQLBackend::list(const string &target, int domain_id ) 107 107 { 108 108 DLOG(L<<backendName<<" MySQLBackend constructing handle for list of domain id '"<<domain_id<<"'"<<endl); -
trunk/pdns/modules/mysqlbackend/mysqlcbackend.hh
r18 r180 23 23 24 24 void lookup(const QType &, const string &qdomain, DNSPacket *p=0, int zoneId=-1); 25 bool list( int domain_id);25 bool list(const string &target, int domain_id); 26 26 bool get(DNSResourceRecord &r); 27 27 -
trunk/pdns/modules/oraclebackend/oraclebackend.cc
r10 r180 1 // $Id: oraclebackend.cc,v 1. 1 2002/11/27 15:35:52ahu Exp $1 // $Id: oraclebackend.cc,v 1.2 2003/08/22 13:33:31 ahu Exp $ 2 2 3 3 #include <string> … … 376 376 } 377 377 378 bool OracleBackend::list( int domain_id)378 bool OracleBackend::list(const string &target, int domain_id) 379 379 { 380 380 mQueryId = domain_id; -
trunk/pdns/modules/oraclebackend/oraclebackend.hh
r10 r180 1 // $Id: oraclebackend.hh,v 1. 1 2002/11/27 15:35:52ahu Exp $1 // $Id: oraclebackend.hh,v 1.2 2003/08/22 13:33:31 ahu Exp $ 2 2 3 3 #include <string> … … 73 73 74 74 void lookup(const QType &, const string &qdomain, DNSPacket *p=0, int zoneId=-1); 75 bool list( int domain_id);75 bool list(const string &target, int domain_id); 76 76 bool get(DNSResourceRecord &r); 77 77 -
trunk/pdns/modules/pdnsbackend/pdnsbackend.cc
r160 r180 1 // $Id: pdnsbackend.cc,v 1. 5 2003/03/13 12:45:30ahu Exp $1 // $Id: pdnsbackend.cc,v 1.6 2003/08/22 13:33:31 ahu Exp $ 2 2 3 3 #include <string> … … 129 129 } 130 130 131 bool PdnsBackend::list( int inZoneId)131 bool PdnsBackend::list(const string &target, int inZoneId) 132 132 { 133 133 //cout << "PdnsBackend::list" << endl; -
trunk/pdns/modules/pdnsbackend/pdnsbackend.hh
r160 r180 1 // $Id: pdnsbackend.hh,v 1. 4 2003/03/13 12:45:30ahu Exp $1 // $Id: pdnsbackend.hh,v 1.5 2003/08/22 13:33:31 ahu Exp $ 2 2 3 3 #ifndef PDNSBACKEND_HH … … 19 19 20 20 void lookup(const QType &, const string &qdomain, DNSPacket *p = 0, int zoneId = -1); 21 bool list( int inZoneId);21 bool list(const string &target, int inZoneId); 22 22 bool get(DNSResourceRecord& outRecord); 23 23 bool getSOA(const string &name, SOAData &soadata); -
trunk/pdns/modules/pipebackend/pipebackend.cc
r77 r180 1 1 // -*- sateh-c -*- 2 2 // File : pdnsbackend.cc 3 // Version : $Id: pipebackend.cc,v 1. 4 2002/12/16 13:04:27ahu Exp $3 // Version : $Id: pipebackend.cc,v 1.5 2003/08/22 13:33:31 ahu Exp $ 4 4 // 5 5 … … 119 119 } 120 120 121 bool PipeBackend::list( int inZoneId)121 bool PipeBackend::list(const string &target, int inZoneId) 122 122 { 123 123 try { -
trunk/pdns/modules/pipebackend/pipebackend.hh
r8 r180 1 1 // 2 2 // File : pdnsbackend.hh 3 // Version : $Id: pipebackend.hh,v 1. 1 2002/11/27 15:31:59ahu Exp $3 // Version : $Id: pipebackend.hh,v 1.2 2003/08/22 13:33:31 ahu Exp $ 4 4 // 5 5 … … 60 60 ~PipeBackend(); 61 61 void lookup(const QType &, const string &qdomain, DNSPacket *p=0, int zoneId=-1); 62 bool list( int domain_id);62 bool list(const string &target, int domain_id); 63 63 bool get(DNSResourceRecord &r); 64 64 -
trunk/pdns/modules/xdbbackend/xdbbackend.cc
r13 r180 31 31 } 32 32 33 bool list( int id) {33 bool list(const string &target, int id) { 34 34 return false; // we don't support AXFR (go away) 35 35 } -
trunk/pdns/pdns/backends/bind/bindbackend.cc
r148 r180 16 16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 */ 18 // $Id: bindbackend.cc,v 1.1 5 2003/02/10 11:09:09ahu Exp $18 // $Id: bindbackend.cc,v 1.16 2003/08/22 13:33:31 ahu Exp $ 19 19 #include <errno.h> 20 20 #include <string> … … 757 757 } 758 758 759 bool BindBackend::list( int id)759 bool BindBackend::list(const string &target, int id) 760 760 { 761 761 if(!d_zone_id_map.count(id)) -
trunk/pdns/pdns/backends/bind/bindbackend.hh
r146 r180 178 178 179 179 void lookup(const QType &, const string &qdomain, DNSPacket *p=0, int zoneId=-1); 180 bool list( int id);180 bool list(const string &target, int id); 181 181 bool get(DNSResourceRecord &); 182 182 -
trunk/pdns/pdns/backends/bind/bindbackend2.cc
r164 r180 16 16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 */ 18 // $Id: bindbackend2.cc,v 1. 3 2003/03/20 13:29:29ahu Exp $18 // $Id: bindbackend2.cc,v 1.4 2003/08/22 13:33:31 ahu Exp $ 19 19 #include <errno.h> 20 20 #include <string> … … 727 727 } 728 728 729 bool Bind2Backend::list( int id)730 { 731 cout<<"List of id "<<id<<" requested"<<endl;729 bool Bind2Backend::list(const string &target, int id) 730 { 731 // cout<<"List of id "<<id<<" requested"<<endl; 732 732 if(!s_id_zone_map.count(id)) 733 733 return false; -
trunk/pdns/pdns/backends/bind/bindbackend2.hh
r158 r180 179 179 180 180 void lookup(const QType &, const string &qdomain, DNSPacket *p=0, int zoneId=-1); 181 bool list( int id);181 bool list(const string &target, int id); 182 182 bool get(DNSResourceRecord &); 183 183 -
trunk/pdns/pdns/backends/gsql/gsqlbackend.cc
r174 r180 1 // $Id: gsqlbackend.cc,v 1. 8 2003/06/21 09:59:08ahu Exp $1 // $Id: gsqlbackend.cc,v 1.9 2003/08/22 13:33:31 ahu Exp $ 2 2 #include <string> 3 3 #include <map> … … 134 134 sd.id=atol(d_result[n][0].c_str()); 135 135 sd.zone=d_result[n][1]; 136 cout<<"master='"<<d_result[n][2]<<"'"<<endl;137 136 sd.master=d_result[n][2]; 138 137 sd.last_check=atol(d_result[n][3].c_str()); … … 301 300 d_count=0; 302 301 } 303 bool GSQLBackend::list( int domain_id )302 bool GSQLBackend::list(const string &target, int domain_id ) 304 303 { 305 304 DLOG(L<<"GSQLBackend constructing handle for list of domain id'"<<domain_id<<"'"<<endl); -
trunk/pdns/pdns/backends/gsql/gsqlbackend.hh
r108 r180 24 24 string sqlEscape(const string &name); 25 25 void lookup(const QType &, const string &qdomain, DNSPacket *p=0, int zoneId=-1); 26 bool list( int domain_id);26 bool list(const string &target, int domain_id); 27 27 bool get(DNSResourceRecord &r); 28 28 bool isMaster(const string &domain, const string &ip); -
trunk/pdns/pdns/common_startup.cc
r159 r180 76 76 arg().set("launch","Which backends to launch and order to query them in")=""; 77 77 arg().setSwitch("disable-axfr","Disable zonetransfers but do allow TCP queries")="no"; 78 arg().set("allow-axfr-ips"," If disabled, DO allow zonetransfersfrom these IP addresses")="";78 arg().set("allow-axfr-ips","Allow zonetransfers only from these IP addresses")=""; 79 79 arg().set("slave-cycle-interval","Reschedule failed SOA serial checks once every .. seconds")="60"; 80 80 -
trunk/pdns/pdns/dnsbackend.cc
r128 r180 240 240 time_t newest=0; 241 241 242 if(!(this->list( sd.domain_id)))242 if(!(this->list(domain, sd.domain_id))) 243 243 throw AhuException("Backend error trying to determine magic serial number of zone '"+domain+"'"); 244 244 -
trunk/pdns/pdns/dnsbackend.hh
r104 r180 17 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 // $Id: dnsbackend.hh,v 1. 5 2002/12/30 21:00:56ahu Exp $19 // $Id: dnsbackend.hh,v 1.6 2003/08/22 13:33:31 ahu Exp $ 20 20 /* (C) 2002 POWERDNS.COM BV */ 21 21 … … 81 81 \param domain_id ID of which a list is requested 82 82 */ 83 virtual bool list( int domain_id)=0;83 virtual bool list(const string &target, int domain_id)=0; 84 84 85 85 virtual ~DNSBackend(){}; -
trunk/pdns/pdns/packethandler.hh
r159 r180 31 31 32 32 using namespace std; 33 34 // silly Solaris people define PC 35 #undef PC 33 36 34 37 /** Central DNS logic according to RFC1034. Ask this class a question in the form of a DNSPacket -
trunk/pdns/pdns/pdns_recursor.cc
r178 r180 36 36 #include "arguments.hh" 37 37 #include "syncres.hh" 38 #include <fcntl.h> 39 #include <fstream> 40 41 string s_programname="pdns_recursor"; 38 42 39 43 #ifndef WIN32 … … 161 165 162 166 167 static void writePid(void) 168 { 169 string fname=arg()["socket-dir"]+"/"+s_programname+".pid"; 170 ofstream of(fname.c_str()); 171 if(of) 172 of<<getpid()<<endl; 173 else 174 L<<Logger::Error<<"Requested to write pid for "<<getpid()<<" to "<<fname<<"failed: "<<strerror(errno)<<endl; 175 } 176 163 177 void init(void) 164 178 { … … 432 446 arg().set("quiet","Suppress logging of questions and answers")="off"; 433 447 arg().set("config-dir","Location of configuration directory (recursor.conf)")=SYSCONFDIR; 448 arg().set("socket-dir","Where the controlsocket will live")=LOCALSTATEDIR; 434 449 arg().setCmd("help","Provide a helpful message"); 435 450 L.toConsole(Logger::Warning); … … 471 486 } 472 487 signal(SIGUSR1,usr1Handler); 488 489 writePid(); 473 490 #endif 474 491 -
trunk/pdns/pdns/randombackend.cc
r2 r180 35 35 } 36 36 37 bool list( int id) {37 bool list(const string &target, int id) { 38 38 return false; // we don't support AXFR 39 39 } -
trunk/pdns/pdns/receiver.cc
r157 r180 17 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 // $Id: receiver.cc,v 1. 8 2003/03/06 16:59:11 ahu Exp $19 // $Id: receiver.cc,v 1.9 2003/08/22 13:33:31 ahu Exp $ 20 20 #include <cstdio> 21 21 #include <signal.h> … … 156 156 { 157 157 kill(cpid,SIGKILL); // why? 158 kill(cpid,SIGKILL); // why? 159 160 sleep(1); 158 161 return "ok"; 159 162 } -
trunk/pdns/pdns/tcpreceiver.cc
r178 r180 331 331 332 332 // now list zone 333 if(!(B->list( sd.domain_id))) {333 if(!(B->list(target, sd.domain_id))) { 334 334 L<<Logger::Error<<"Backend signals error condition"<<endl; 335 335 outpacket->setRcode(2); // 'SERVFAIL' -
trunk/pdns/pdns/ueberbackend.cc
r148 r180 17 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 // $Id: ueberbackend.cc,v 1.1 0 2003/02/10 11:09:09ahu Exp $19 // $Id: ueberbackend.cc,v 1.11 2003/08/22 13:33:31 ahu Exp $ 20 20 /* (C) Copyright 2002 PowerDNS.COM BV */ 21 21 #include "utility.hh" … … 372 372 } 373 373 374 bool UeberBackend::list( int domain_id)374 bool UeberBackend::list(const string &target, int domain_id) 375 375 { 376 376 L<<Logger::Error<<"UeberBackend::list called, should NEVER EVER HAPPEN"<<endl; -
trunk/pdns/pdns/ueberbackend.hh
r104 r180 116 116 117 117 bool getSOA(const string &domain, SOAData &sd); 118 bool list( int domain_id);118 bool list(const string &target, int domain_id); 119 119 bool get(DNSResourceRecord &r); 120 120