Changeset 1150
- Timestamp:
- 03/04/08 22:44:35 (7 months ago)
- Files:
-
- trunk/pdns/pdns/docs/pdns.sgml (modified) (1 diff)
- trunk/pdns/pdns/iputils.hh (modified) (3 diffs)
- trunk/pdns/pdns/pdns_recursor.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pdns/pdns/docs/pdns.sgml
r1145 r1150 7293 7293 </listitem> 7294 7294 </varlistentry> 7295 <varlistentry> 7296 <term>allow-from-file</term> 7297 <listitem> 7298 <para> 7299 Like <command>allow-from</command>, except reading from file. Overrides the 'allow-from' setting. 7300 To use this feature, supply one netmask per line, with optional comments preceeded by a #. 7301 Available since 3.1.5. 7302 </para> 7303 </listitem> 7304 </varlistentry> 7305 7295 7306 <varlistentry> 7296 7307 <term>auth-can-lower-ttl</term> trunk/pdns/pdns/iputils.hh
r1075 r1150 1 1 /* 2 2 PowerDNS Versatile Database Driven Nameserver 3 Copyright (C) 2002 - 200 7PowerDNS.COM BV3 Copyright (C) 2002 - 2008 PowerDNS.COM BV 4 4 5 5 This program is free software; you can redistribute it and/or modify … … 263 263 } 264 264 265 string toString() const 266 { 267 return d_network.toString()+"/"+boost::lexical_cast<string>(d_bits); 268 } 269 265 270 private: 266 271 ComboAddress d_network; … … 295 300 } 296 301 302 unsigned int size() 303 { 304 return (unsigned int)d_masks.size(); 305 } 306 307 string toString() const 308 { 309 ostringstream str; 310 for(container_t::const_iterator iter = d_masks.begin(); iter != d_masks.end(); ++iter) { 311 if(iter != d_masks.begin()) 312 str <<", "; 313 str<<iter->toString(); 314 } 315 return str.str(); 316 } 317 318 297 319 private: 298 320 typedef vector<Netmask> container_t; trunk/pdns/pdns/pdns_recursor.cc
r1135 r1150 1543 1543 SyncRes::s_domainmap[parts[0]]=ad; 1544 1544 } 1545 L<<Logger::Warning<<"Done parsing " << SyncRes::s_domainmap.size() - before<<" forwarding instructions "<<endl;1545 L<<Logger::Warning<<"Done parsing " << SyncRes::s_domainmap.size() - before<<" forwarding instructions from file '"<<::arg()["forward-zones-files"]<<"'"<<endl; 1546 1546 } 1547 1547 … … 1619 1619 1620 1620 L<<Logger::Warning<<"Operating in "<<(sizeof(unsigned long)*8) <<" bits mode"<<endl; 1621 1622 if(!::arg()["allow-from"].empty()) { 1621 1622 if(!::arg()["allow-from-file"].empty()) { 1623 string line; 1624 g_allowFrom=new NetmaskGroup; 1625 ifstream ifs(::arg()["allow-from-file"].c_str()); 1626 if(!ifs) { 1627 throw AhuException("Could not open '"+::arg()["allow-from-file"]+"': "+stringerror()); 1628 } 1629 1630 string::size_type pos; 1631 while(getline(ifs,line)) { 1632 pos=line.find('#'); 1633 if(pos!=string::npos) 1634 line.resize(pos); 1635 trim(line); 1636 if(line.empty()) 1637 continue; 1638 1639 g_allowFrom->addMask(line); 1640 } 1641 L<<Logger::Warning<<"Done parsing " << g_allowFrom->size() <<" allow-from ranges from file '"<<::arg()["allow-from-file"]<<"' - overriding 'allow-from' setting"<<endl; 1642 } 1643 else if(!::arg()["allow-from"].empty()) { 1623 1644 g_allowFrom=new NetmaskGroup; 1624 1645 vector<string> ips; … … 1636 1657 L<<Logger::Error<<"WARNING: Allowing queries from all IP addresses - this can be a security risk!"<<endl; 1637 1658 1659 1638 1660 if(!::arg()["dont-query"].empty()) { 1639 1661 g_dontQuery=new NetmaskGroup; … … 1861 1883 ::arg().set("version-string", "string reported on version.pdns or version.bind")="PowerDNS Recursor "VERSION" $Id$"; 1862 1884 ::arg().set("allow-from", "If set, only allow these comma separated netmasks to recurse")="127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10"; 1885 ::arg().set("allow-from-file", "If set, load allowed netmasks from this file")=""; 1863 1886 ::arg().set("dont-query", "If set, do not query these netmasks for DNS data")="127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10"; 1864 1887 ::arg().set("max-tcp-per-client", "If set, maximum number of TCP sessions per client (IP address)")="0";