]> granicus.if.org Git - pdns/commitdiff
Use include files when processing acls
authorAki Tuomi <cmouse@desteem.org>
Tue, 4 Feb 2014 17:12:08 +0000 (19:12 +0200)
committerAki Tuomi <cmouse@desteem.org>
Fri, 7 Feb 2014 10:56:22 +0000 (12:56 +0200)
pdns/arguments.cc
pdns/pdns_recursor.cc

index 57b1539faaf081d7a33111a9e49bc507841ec292..0200140b1bdd96e387cb5d9a382ca347dadc3e96 100644 (file)
@@ -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<std::string> &extraConfigs) {
       }
     }
     std::sort(extraConfigs.begin(), extraConfigs.end(), CIStringComparePOSIX()); 
+    closedir(dir);
 }
index 9cde5380c4dd08adff1a77618cb85f0e99c52cf6..e80ffab5f61fb949b0dbba042de61ab1c41af72c 100644 (file)
@@ -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<std::string> 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;