From: Aki Tuomi Date: Tue, 4 Feb 2014 17:12:08 +0000 (+0200) Subject: Use include files when processing acls X-Git-Tag: rec-3.6.0-rc1~190^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=829849d67d783480f501ccd61fa0a354d7c5a7ed;p=thirdparty%2Fpdns.git Use include files when processing acls --- diff --git a/pdns/arguments.cc b/pdns/arguments.cc index 57b1539faa..0200140b1b 100644 --- a/pdns/arguments.cc +++ b/pdns/arguments.cc @@ -473,7 +473,6 @@ bool ArgvMap::file(const char *fname, bool lax, bool included) throw ArgException(fn + " could not be parsed"); } } - closedir(dir); } return true; @@ -518,4 +517,5 @@ void ArgvMap::gatherIncludes(std::vector &extraConfigs) { } } std::sort(extraConfigs.begin(), extraConfigs.end(), CIStringComparePOSIX()); + closedir(dir); } diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 9cde5380c4..e80ffab5f6 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1632,6 +1632,14 @@ void parseACLs() ::arg().preParse(g_argc, g_argv, "allow-from-file"); ::arg().preParseFile(configname.c_str(), "allow-from", LOCAL_NETS); ::arg().preParse(g_argc, g_argv, "allow-from"); + ::arg().preParse(g_argc, g_argv, "include-dir"); + + // then process includes + std::vector extraConfigs; + BOOST_FOREACH(const std::string& fn, extraConfigs) { + ::arg().preParseFile(fn.c_str(), "allow-from-file"); + ::arg().preParseFile(fn.c_str(), "allow-from"); + } } NetmaskGroup* oldAllowFrom = t_allowFrom, *allowFrom=new NetmaskGroup;