Subject: | Included directories |
Hi,
Since version 1.3.13 Apache can include whole directories in its config
file, but this Perl module cannot handle this case.
I'm attaching a patch by Tobias Gruetzmacher that fixes this. It is included in the Debian version of Apache::ConfigFile.
(For reference, this was originally reported as Debian bug #204841, http://bugs.debian.org/204841 .)
--
Niko Tyni
ntyni@iki.fi
--- libapache-configfile-perl-1.18.orig/ConfigFile.pm
+++ libapache-configfile-perl-1.18/ConfigFile.pm
@@ -168,6 +168,19 @@
# add the server root unless it's a /full/path/name
$file = "$server_root/$file" if $file !~ m!^/! && $server_root;
+ # Handling for directories
+ if (-d $file) {
+ opendir(DIR, $file)
+ || croak("Cannot open directory '$file': $! (do you need to define ServerRoot?)");
+ my @conf;
+ while (defined(my $entry = readdir(DIR))) {
+ next if $entry =~ /^\.\.?$/;
+ push @conf, _include($self, $file."/".$entry);
+ }
+ closedir(DIR);
+ return @conf;
+ }
+
open(CONF, "<$file")
|| croak("Cannot read '$file': $! (do you need to define ServerRoot?)");
chomp(my @conf = <CONF>);