From: bert hubert Date: Fri, 4 Apr 2014 09:08:32 +0000 (+0200) Subject: add single-ip-zone creation option X-Git-Tag: rec-3.6.0-rc1~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f643957917f2e70d65cf0f626f1f59652d190c0;p=thirdparty%2Fpdns.git add single-ip-zone creation option --- diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index b44217cd37..0741b4dca1 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -188,10 +188,14 @@ static void doCreateZone(const Value& document) if(zonename.empty()) throw ApiException("Zone name empty"); + if(zonename.find('/') != string::npos) + throw ApiException("Illegal character in zone name"); + if (zonename[zonename.size()-1] != '.') { zonename += "."; } + string singleIPTarget = stringFromJson(document, "single-ip-target", ""); string kind = toUpper(stringFromJson(document, "kind")); bool rd = boolFromJson(document, "recursion_desired"); string confbasename = "zone-" + apiZoneNameToId(zonename); @@ -207,6 +211,10 @@ static void doCreateZone(const Value& document) } ofzone << "; Generated by pdns-recursor REST API, DO NOT EDIT" << endl; ofzone << zonename << "\tIN\tSOA\tlocal.zone.\thostmaster."<