From: Otto Moerbeek Date: Fri, 8 Dec 2023 08:37:08 +0000 (+0100) Subject: Respect RUNTIME_DIRECTORY as a default for socket-dir X-Git-Tag: dnsdist-1.9.0-alpha4~11^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f2e6cf3ae0f4622bea9364d75dc205728a553e5b;p=thirdparty%2Fpdns.git Respect RUNTIME_DIRECTORY as a default for socket-dir This was lost with the conversion to the new settings. --- diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 0e64433b66..5a6f715922 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -2941,6 +2941,13 @@ static void handleRuntimeDefaults(Logr::log_t log) ::arg().set("server-id") = myHostname.has_value() ? *myHostname : ""; } + if (::arg()["socket-dir"].empty()) { + auto* runtimeDir = getenv("RUNTIME_DIRECTORY"); // NOLINT(concurrency-mt-unsafe,cppcoreguidelines-pro-type-vararg) + if (runtimeDir != nullptr) { + ::arg().set("socket-dir") = runtimeDir; + } + } + if (::arg()["socket-dir"].empty()) { if (::arg()["chroot"].empty()) { ::arg().set("socket-dir") = std::string(LOCALSTATEDIR) + "/pdns-recursor";