From: Aki Tuomi Date: Tue, 3 Feb 2015 19:08:31 +0000 (+0200) Subject: Try to raise open files before dropping privileges X-Git-Tag: auth-3.4.4~19^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2317%2Fhead;p=thirdparty%2Fpdns.git Try to raise open files before dropping privileges --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index b4cf358a25..3c4efdf589 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1879,6 +1879,9 @@ int serviceMain(int argc, char*argv[]) signal(SIGPIPE,SIG_IGN); writePid(); makeControlChannelSocket( ::arg().asNum("processes") > 1 ? forks : -1); + g_numThreads = ::arg().asNum("threads") + ::arg().mustDo("pdns-distributes-queries"); + g_maxMThreads = ::arg().asNum("max-mthreads"); + checkOrFixFDS(); int newgid=0; if(!::arg()["setgid"].empty()) @@ -1897,14 +1900,11 @@ int serviceMain(int argc, char*argv[]) } Utility::dropUserPrivs(newuid); - g_numThreads = ::arg().asNum("threads") + ::arg().mustDo("pdns-distributes-queries"); makeThreadPipes(); g_tcpTimeout=::arg().asNum("client-tcp-timeout"); g_maxTCPPerClient=::arg().asNum("max-tcp-per-client"); - g_maxMThreads=::arg().asNum("max-mthreads"); - checkOrFixFDS(); if(g_numThreads == 1) { L<