From: Bert Hubert Date: Thu, 2 Mar 2006 19:32:49 +0000 (+0000) Subject: remove some duplicate ;'s X-Git-Tag: pdns-2.9.20~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5762f14e3c7c9c5a37e4dfb94078a219fdffc51a;p=thirdparty%2Fpdns.git remove some duplicate ;'s teach dynhandler to reject non-ip address parameters to notify-host plus defense in depth, make powerdns not exit if asked to notify non-ip address Close ticket 24 git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@565 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/communicator.cc b/pdns/communicator.cc index 48b6c74b42..42021ddb9b 100644 --- a/pdns/communicator.cc +++ b/pdns/communicator.cc @@ -317,8 +317,13 @@ int CommunicatorClass::doNotifications() bool purged; while(d_nq.getOne(domain, ip, &id, purged)) { if(!purged) { - d_nresolver.notify(d_nsock,domain,ip,id); - drillHole(domain,ip); + try { + d_nresolver.notify(d_nsock, domain, ip, id); + drillHole(domain, ip); + } + catch(ResolverException &re) { + L<parts; diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index bba95a7d34..3bdb45c513 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -203,6 +203,11 @@ string DLNotifyHostHandler(const vector&parts, Utility::pid_t ppid) ostringstream os; if(parts.size()!=3) return "syntax: notify-host domain ip"; + + struct in_addr inp; + if(!Utility::inet_aton(parts[2].c_str(),&inp)) + return "Unable to convert '"+parts[2]+"' to an IP address"; + L<