From c00908f1e29a97047fe7d6040729bb34625598f8 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 16 Oct 2017 11:37:26 +0200 Subject: [PATCH] API: Fully boolify api_rectify --- docs/http-api/zone.rst | 2 +- pdns/ws-auth.cc | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/http-api/zone.rst b/docs/http-api/zone.rst index 282f7d2f7..2a6acd517 100644 --- a/docs/http-api/zone.rst +++ b/docs/http-api/zone.rst @@ -38,7 +38,7 @@ Comments are per-RRset. Switching ``dnssec`` to ``true`` (from ``false``) sets up DNSSEC signing based on the other flags, this includes running the equivalent of - ``secure-zone`` and ``rectify-zone`` (if ``api_rectify`` is set to "1"). + ``secure-zone`` and ``rectify-zone`` (if ``api_rectify`` is set to ``true``). This also applies to newly created zones. If ``presigned`` is ``true``, no DNSSEC changes will be made to the zone or cryptokeys. diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 9d22bd718..02dfbb338 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -564,9 +564,12 @@ static void updateDomainSettingsFromDocument(UeberBackend& B, const DomainInfo& if (document["soa_edit"].is_string()) { di.backend->setDomainMetadataOne(zonename, "SOA-EDIT", document["soa_edit"].string_value()); } - if (document["api_rectify"].is_string()) { - di.backend->setDomainMetadataOne(zonename, "API-RECTIFY", document["api_rectify"].string_value()); + try { + bool api_rectify = boolFromJson(document, "api_rectify"); + di.backend->setDomainMetadataOne(zonename, "API-RECTIFY", api_rectify ? "1" : "0"); } + catch (JsonException) {} + if (document["account"].is_string()) { di.backend->setAccount(zonename, document["account"].string_value()); } -- 2.40.0