From: Kees Monshouwer Date: Sat, 2 Sep 2023 13:21:53 +0000 (+0200) Subject: auth: catalog, include groups in hash calculation X-Git-Tag: dnsdist-1.10.0-alpha0~6^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b099d811a88948ff53389895cf27e85bcdf1ba70;p=thirdparty%2Fpdns.git auth: catalog, include groups in hash calculation --- diff --git a/pdns/auth-catalogzone.cc b/pdns/auth-catalogzone.cc index b8d825dd5..2fd736928 100644 --- a/pdns/auth-catalogzone.cc +++ b/pdns/auth-catalogzone.cc @@ -94,7 +94,7 @@ std::string CatalogInfo::toJson() const } if (!d_group.empty()) { json11::Json::array entries; - for (const string& group : d_group) { + for (const auto& group : d_group) { entries.push_back(group); } object["group"] = entries; @@ -107,7 +107,10 @@ std::string CatalogInfo::toJson() const void CatalogInfo::updateHash(CatalogHashMap& hashes, const DomainInfo& di) const { - hashes[di.catalog].process(static_cast(di.id) + di.zone.toLogString() + "\0" + d_coo.toLogString() + "\0" + d_unique.toLogString()); + hashes[di.catalog].process(std::to_string(di.id) + di.zone.toLogString() + "\0" + d_coo.toLogString() + "\0" + d_unique.toLogString()); + for (const auto& group : d_group) { + hashes[di.catalog].process(std::to_string(group.length()) + group); + } } DNSZoneRecord CatalogInfo::getCatalogVersionRecord(const DNSName& zone)