Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy fixes #13776

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions modules/geoipbackend/geoipbackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ bool GeoIPBackend::getDomainInfo(const DNSName& domain, DomainInfo& di, bool /*
{
ReadLock rl(&s_state_lock);

for (GeoIPDomain dom : s_domains) {
for (const GeoIPDomain& dom : s_domains) {
if (dom.domain == domain) {
SOAData sd;
this->getSOA(domain, sd);
Expand Down Expand Up @@ -933,7 +933,7 @@ bool GeoIPBackend::getAllDomainMetadata(const DNSName& name, std::map<std::strin
return false;

ReadLock rl(&s_state_lock);
for (GeoIPDomain dom : s_domains) {
for (const GeoIPDomain& dom : s_domains) {
if (dom.domain == name) {
if (hasDNSSECkey(dom.domain)) {
meta[string("NSEC3NARROW")].push_back("1");
Expand All @@ -951,7 +951,7 @@ bool GeoIPBackend::getDomainMetadata(const DNSName& name, const std::string& kin
return false;

ReadLock rl(&s_state_lock);
for (GeoIPDomain dom : s_domains) {
for (const GeoIPDomain& dom : s_domains) {
if (dom.domain == name) {
if (hasDNSSECkey(dom.domain)) {
if (kind == "NSEC3NARROW")
Expand All @@ -970,7 +970,7 @@ bool GeoIPBackend::getDomainKeys(const DNSName& name, std::vector<DNSBackend::Ke
if (!d_dnssec)
return false;
ReadLock rl(&s_state_lock);
for (GeoIPDomain dom : s_domains) {
for (const GeoIPDomain& dom : s_domains) {
if (dom.domain == name) {
regex_t reg;
regmatch_t regm[5];
Expand Down Expand Up @@ -1016,7 +1016,7 @@ bool GeoIPBackend::removeDomainKey(const DNSName& name, unsigned int id)
WriteLock rl(&s_state_lock);
ostringstream path;

for (GeoIPDomain dom : s_domains) {
for (const GeoIPDomain& dom : s_domains) {
if (dom.domain == name) {
regex_t reg;
regmatch_t regm[5];
Expand Down Expand Up @@ -1052,7 +1052,7 @@ bool GeoIPBackend::addDomainKey(const DNSName& name, const KeyData& key, int64_t
WriteLock rl(&s_state_lock);
unsigned int nextid = 1;

for (GeoIPDomain dom : s_domains) {
for (const GeoIPDomain& dom : s_domains) {
if (dom.domain == name) {
regex_t reg;
regmatch_t regm[5];
Expand Down Expand Up @@ -1088,7 +1088,7 @@ bool GeoIPBackend::activateDomainKey(const DNSName& name, unsigned int id)
if (!d_dnssec)
return false;
WriteLock rl(&s_state_lock);
for (GeoIPDomain dom : s_domains) {
for (const GeoIPDomain& dom : s_domains) {
if (dom.domain == name) {
regex_t reg;
regmatch_t regm[5];
Expand Down Expand Up @@ -1123,7 +1123,7 @@ bool GeoIPBackend::deactivateDomainKey(const DNSName& name, unsigned int id)
if (!d_dnssec)
return false;
WriteLock rl(&s_state_lock);
for (GeoIPDomain dom : s_domains) {
for (const GeoIPDomain& dom : s_domains) {
if (dom.domain == name) {
regex_t reg;
regmatch_t regm[5];
Expand Down
2 changes: 1 addition & 1 deletion modules/geoipbackend/geoipinterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ unique_ptr<GeoIPInterface> GeoIPInterface::makeInterface(const string& dbStr)
stringtok(parts2, parts1[0], ";");
/* try extension */
filename = parts2[0];
size_t pos = filename.find_last_of(".");
size_t pos = filename.find_last_of('.');
if (pos != string::npos)
driver = filename.substr(pos + 1);
else
Expand Down
9 changes: 5 additions & 4 deletions pdns/pdnsutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -924,10 +924,11 @@ static int increaseSerial(const DNSName& zone, DNSSECKeeper &dk)

sd.db->startTransaction(zone, -1);

if (!sd.db->replaceRRSet(sd.domain_id, zone, rr.qtype, {rr})) {
sd.db->abortTransaction();
cerr<<"Backend did not replace SOA record. Backend might not support this operation."<<endl;
return -1;
auto rrs = vector<DNSResourceRecord>{rr};
if (!sd.db->replaceRRSet(sd.domain_id, zone, rr.qtype, rrs)) {
neheb marked this conversation as resolved.
Show resolved Hide resolved
sd.db->abortTransaction();
cerr << "Backend did not replace SOA record. Backend might not support this operation." << endl;
return -1;
}

if (sd.db->doesDNSSEC()) {
Expand Down
Loading