From: Klaus Darilion Date: Mon, 18 Feb 2019 10:42:16 +0000 (+0000) Subject: store masters with comma separated and without trailing space X-Git-Tag: auth-4.2.0-beta1~18^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=495705622dcc14513a86b37b2cd966e583d3fcfe;p=thirdparty%2Fpdns.git store masters with comma separated and without trailing space --- diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index b2ab3a2d86..8d75ed1c74 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -603,17 +603,17 @@ static void throwUnableToSecure(const DNSName& zonename) { } static void updateDomainSettingsFromDocument(UeberBackend& B, const DomainInfo& di, const DNSName& zonename, const Json document) { - string zonemaster; + vector zonemaster; bool shouldRectify = false; for(auto value : document["masters"].array_items()) { string master = value.string_value(); if (master.empty()) throw ApiException("Master can not be an empty string"); - zonemaster += master + " "; + zonemaster.push_back(master); } - if (zonemaster != "") { - di.backend->setMaster(zonename, zonemaster); + if (zonemaster.size()) { + di.backend->setMaster(zonename, boost::join(zonemaster, ",")); } if (document["kind"].is_string()) { di.backend->setKind(zonename, DomainInfo::stringToKind(stringFromJson(document, "kind")));