From: Otto Moerbeek Date: Wed, 3 Dec 2025 08:48:25 +0000 (+0100) Subject: 1643013 Check of thread-shared field evades lock acquisition X-Git-Tag: rec-5.4.0-alpha1~28^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0228427a0785d1fe240743e757a539632c1f13ab;p=thirdparty%2Fpdns.git 1643013 Check of thread-shared field evades lock acquisition Signed-off-by: Otto Moerbeek --- diff --git a/pdns/recursordist/rec_channel_rec.cc b/pdns/recursordist/rec_channel_rec.cc index fefcfd1c5f..5be4e6d006 100644 --- a/pdns/recursordist/rec_channel_rec.cc +++ b/pdns/recursordist/rec_channel_rec.cc @@ -738,9 +738,10 @@ static Answer doSetDnssecLogBogus(ArgIterator begin, ArgIterator end) } if (pdns_iequals(*begin, "off") || pdns_iequals(*begin, "no")) { + auto lock = g_yamlStruct.lock(); if (g_dnssecLogBogus) { g_log << Logger::Warning << "Disabling DNSSEC Bogus logging, requested via control channel" << endl; - g_yamlStruct.lock()->dnssec.log_bogus = g_dnssecLogBogus = false; + lock->dnssec.log_bogus = g_dnssecLogBogus = false; return {0, "DNSSEC Bogus logging disabled\n"}; } return {0, "DNSSEC Bogus logging was already disabled\n"};