Skip Menu |

This queue is for tickets about the Apache-ConfigFile CPAN distribution.

Report information
The Basics
Id: 16841
Status: rejected
Priority: 0/
Queue: Apache-ConfigFile

People
Owner: Nobody in particular
Requestors: ntyni [...] iki.fi
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.18
Fixed in: (no value)



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>);
I appreciate the bug report, but please use Config::ApacheFormat instead of this module. I have contributed several patches to that module, and it is far more robust. Thanks!