Re: Bug#251048: apache-common: listconffiles doesn't cope well with extra whitespace
Hi
On Wed, 26 May 2004, Colm Buckley wrote:
> Package: apache-common
> Version: 1.3.31-1
> Severity: normal
>
> listconffiles doesn't cope well with extra whitespace in the lines
> containing ServerRoot or Include directives in httpd.conf. The attached
> patch makes it a lot happier.
>
>
> --- listconffiles.dist 2004-05-26 16:48:59.000000000 +0100
> +++ listconffiles 2004-05-26 16:48:08.000000000 +0100
> @@ -85,35 +85,28 @@
> # This takes care of possible multiple serverroot instances.
> # By specifying fields in split we allow for filename containing spaces.
> if (/^\s*serverroot/i) {
> - s/^\s*(.*)/$1/;
> - (undef,$serverroot) = split (/\s/,$_,2);
> -
> -# take away surrounding ' and "
> - $serverroot =~ s/[\"\']//g;
> + if (/serverroot\s+"([^"]*)"/i) {
> + $serverroot = $1;
> + }
> + if (/serverroot\s+(.*)$/i) {
> + $serverroot = $1;
> + }
> ($serverroot .= "/") unless ($serverroot =~ m|/$|);
> }
>
> # Build the full path for the included file.
> if (/^\s*include/i) {
> - s/^\s*(.*)/$1/;
> - my (undef,$file) = split (/\s/,$_,2);
> -
> -# take away surrounding ' and "
> - $file =~ s/[\"\']//g;
> -
> + my $file;
> + if (/include\s+"([^"]*)"/i) {
> + $file = $1;
> + }
> + if (/include\s+(.*)$/i) {
> + $file = $1;
> + }
> if ($file !~ m|^/| ) {
> $file = $serverroot . $file;
> }
> -
> -# put back surrounding " only if needed:
> -# if ($file =~ /\s/) {
> -# $file = "\"$file\"";
> -# }
> -
> -# print "DEBUG: filename = $file\n";
> -
> -# Follow the include.
> testfile($file);
> }
> }
Can you kindly include the error you get and add comments to what you
changed and why? I am not a perl expert and i am kinda unhappy to apply
patches without someone reviewing them twice.
Fabio
--
<user> fajita: step one
<fajita> Whatever the problem, step one is always to look in the error log.
<user> fajita: step two
<fajita> When in danger or in doubt, step two is to scream and shout.
Reply to: