From: Bill Stoddard Date: Mon, 9 Dec 2002 15:00:59 +0000 (+0000) Subject: If an httpd.conf has commented out AddModule directives, X-Git-Tag: pre_ajp_proxy~2478 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7686499cedcc3ccb7e120f64c084fa877dae62dd;p=apache If an httpd.conf has commented out AddModule directives, apxs -i -a will add an un-commented AddModule directive for the new module, which breaks the config. PR: 11212 Obtained from: Submitted by: Joe Orton Reviewed by: Bill Stoddard, Thom May git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97820 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 8a8a10fc28..3b6c0d311b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ Changes with Apache 2.1.0-dev + *) If an httpd.conf has commented out AddModule directives, + apxs -i -a will add an un-commented AddModule directive for + the new module, which breaks the config. + PR: 11212 [Joe Orton] [Remove entries to the current 2.0 section below, when backported] diff --git a/support/apxs.in b/support/apxs.in index ed3de518ce..4be6d89328 100644 --- a/support/apxs.in +++ b/support/apxs.in @@ -490,9 +490,8 @@ if ($opt_i or $opt_e) { ## # determine installation commands - # and corresponding LoadModule/AddModule directives + # and corresponding LoadModule directive my @lmd = (); - my @amd = (); my @cmds = (); my $f; foreach $f (@args) { @@ -546,7 +545,6 @@ if ($opt_i or $opt_e) { $dir =~ s|(.)$|$1/|; $t =~ s|\.la$|.so|; push(@lmd, sprintf("LoadModule %-18s %s", "${name}_module", "$dir$t")); - push(@amd, sprintf("AddModule %s", $filename)); } # execute the commands @@ -582,15 +580,7 @@ if ($opt_i or $opt_e) { $lmd =~ m|LoadModule\s+(.+?)_module.*|; notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]"); } - my $amd; - foreach $amd (@amd) { - if ($content !~ m|\n#?\s*$amd|) { - $content =~ s|^(.*\n#?\s*AddModule\s+[^\n]+\n)|$1$c$amd\n|sg; - } else { - $content =~ s|^(.*\n)#?\s*$amd[^\n]*\n|$1$c$amd\n|sg; - } - } - if (@lmd or @amd) { + if (@lmd) { if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) { print FP $content; close(FP);