From: bert hubert Date: Fri, 4 Apr 2014 09:45:49 +0000 (+0200) Subject: align with our GUI, plus allow creation of zones with / in them, turns out we escape... X-Git-Tag: rec-3.6.0-rc1~83 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9081fac85f7ab8393052bce768c6fca950f6f6f;p=thirdparty%2Fpdns.git align with our GUI, plus allow creation of zones with / in them, turns out we escape that --- diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index 0741b4dca1..16887c30f0 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -184,18 +184,15 @@ static void doCreateZone(const Value& document) } string zonename = stringFromJson(document, "name"); - // TODO: better validation of zonename + // TODO: better validation of zonename - apiZoneNameToId takes care of escaping / however 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 singleIPTarget = stringFromJson(document, "single_target_ip", ""); string kind = toUpper(stringFromJson(document, "kind")); bool rd = boolFromJson(document, "recursion_desired"); string confbasename = "zone-" + apiZoneNameToId(zonename);