]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Prevent a race when calling `registerWebHandler` at runtime 14167/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 14 May 2024 07:56:15 +0000 (09:56 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 14 May 2024 07:56:15 +0000 (09:56 +0200)
commita843017673f5b7c1f5c39a3a91592e18ef02d985
tree519f02499793bd84b9a5dfc0ebf7c0abb711a843
parent11610b861bb9f88c297335efd3043e2860f4b6ac
dnsdist: Prevent a race when calling `registerWebHandler` at runtime

The `registerWebHandler()` Lua method can be used to tie a custom Lua
function to an HTTP endpoint. This function was clearly not intended
to be used at runtime but this was never enforced, so let's prevent
a race condition by wrapping the internal web handlers map in a lock.
pdns/dnsdistdist/dnsdist-web.cc