Bug#251048: apache-common: listconffiles doesn't cope well with extra whitespace
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);
}
}
-- System Information:
Debian Release: testing/unstable
Architecture: i386 (i686)
Kernel: Linux 2.4.23
Locale: LANG=C, LC_CTYPE=C
Versions of packages apache-common depends on:
ii apache-utils 1.3.31-1 Utility programs for webservers
ii debconf 1.4.25 Debian configuration management sy
ii libc6 2.3.2.ds1-12 GNU C Library: Shared libraries an
ii libdb4.2 4.2.52-16 Berkeley v4.2 Database Libraries [
ii libexpat1 1.95.6-8 XML parsing C library - runtime li
ii mime-support 3.26-1 MIME files 'mime.types' & 'mailcap
ii perl 5.8.4-2 Larry Wall's Practical Extraction
ii sed 4.0.9-3 The GNU sed stream editor
ii ucf 1.06 Update Configuration File: preserv
-- debconf information excluded
Reply to: