apache2/httpd-2.2.0-apxs-a2enmod.dif
Cristian Rodríguez 647cfe7aba Accepting request 184014 from home:elvigia:branches:Apache
- Update to version 2.4.6
*  SECURITY: CVE-2013-1896 (cve.mitre.org)
*  SECURITY: CVE-2013-2249 (cve.mitre.org)
*  Major updates to mod_lua
*  Support for proxying websocket requests
*  Higher performant shm-based cache implementation
*  Addition of mod_macro for easier configuration management
*  As well as several exciting fixes, especially those related to RFC edge
 cases in mod_cache and mod_proxy.
- IMPORTANT : With the current packaging scheme, we can no longer
Include the ITK MPM, therefore it has been disabled. This is because
this MPM can now only be provided as a loadable module but we do
not currently build MPMs as shared modules but as independant
binaries and all helpers/startup scripts depend on that behaviour.
It will be fixed in the upcoming weeks/months.

OBS-URL: https://build.opensuse.org/request/show/184014
OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=382
2013-07-22 17:04:27 +00:00

114 lines
5.1 KiB
Plaintext

--- httpd-2.4.6.orig/support/apxs.in
+++ httpd-2.4.6/support/apxs.in
@@ -550,108 +550,14 @@ if ($opt_i or $opt_e) {
# activate module via LoadModule/AddModule directive
if ($opt_a or $opt_A) {
- if (not -f "$CFG_SYSCONFDIR/$CFG_TARGET.conf") {
- error("Config file $CFG_SYSCONFDIR/$CFG_TARGET.conf not found");
- exit(1);
- }
-
- open(FP, "<$CFG_SYSCONFDIR/$CFG_TARGET.conf") || die;
- my $content = join('', <FP>);
- close(FP);
-
- if ($content !~ m|\n#?\s*LoadModule\s+|) {
- error("Activation failed for custom $CFG_SYSCONFDIR/$CFG_TARGET.conf file.");
- error("At least one `LoadModule' directive already has to exist.");
- exit(1);
- }
my $lmd;
my $c = '';
$c = '#' if ($opt_A);
foreach $lmd (@lmd) {
- my $what = $opt_A ? "preparing" : "activating";
- my $lmd_re = $lmd;
- $lmd_re =~ s/\s+/\\s+/g;
-
- if ($content !~ m|\n#?\s*$lmd_re|) {
- # check for open <containers>, so that the new LoadModule
- # directive always appears *outside* of an <container>.
-
- my $before = ($content =~ m|^(.*\n)#?\s*LoadModule\s+[^\n]+\n|s)[0];
-
- # the '()=' trick forces list context and the scalar
- # assignment counts the number of list members (aka number
- # of matches) then
- my $cntopen = () = ($before =~ m|^\s*<[^/].*$|mg);
- my $cntclose = () = ($before =~ m|^\s*</.*$|mg);
-
- if ($cntopen == $cntclose) {
- # fine. Last LoadModule is contextless.
- $content =~ s|^(.*\n#?\s*LoadModule\s+[^\n]+\n)|$1$c$lmd\n|s;
- }
- elsif ($cntopen < $cntclose) {
- error('Configuration file is not valid. There are sections'
- . ' closed before opened.');
- exit(1);
- }
- else {
- # put our cmd after the section containing the last
- # LoadModule.
- my $found =
- $content =~ s!\A ( # string and capture start
- (?:(?:
- ^\s* # start of conf line with a
- (?:[^<]|<[^/]) # directive which does not
- # start with '</'
-
- .*(?:$)\n # rest of the line.
- # the '$' is in parentheses
- # to avoid misinterpreting
- # the string "$\" as
- # perl variable.
-
- )* # catch as much as possible
- # of such lines. (including
- # zero)
-
- ^\s*</.*(?:$)\n? # after the above, we
- # expect a config line with
- # a closing container (</)
-
- ) {$cntopen} # the whole pattern (bunch
- # of lines that end up with
- # a closing directive) must
- # be repeated $cntopen
- # times. That's it.
- # Simple, eh? ;-)
-
- ) # capture end
- !$1$c$lmd\n!mx;
-
- unless ($found) {
- error('Configuration file is not valid. There are '
- . 'sections opened and not closed.');
- exit(1);
- }
- }
- } else {
- # replace already existing LoadModule line
- $content =~ s|^(.*\n)#?\s*$lmd_re[^\n]*\n|$1$c$lmd\n|s;
- }
- $lmd =~ m|LoadModule\s+(.+?)_module.*|;
- notice("[$what module `$1' in $CFG_SYSCONFDIR/$CFG_TARGET.conf]");
+ print "activating " . $name . "\n";
+ system("a2enmod " . $name);
}
- if (@lmd) {
- if (open(FP, ">$CFG_SYSCONFDIR/$CFG_TARGET.conf.new")) {
- print FP $content;
- close(FP);
- system("cp $CFG_SYSCONFDIR/$CFG_TARGET.conf $CFG_SYSCONFDIR/$CFG_TARGET.conf.bak && " .
- "cp $CFG_SYSCONFDIR/$CFG_TARGET.conf.new $CFG_SYSCONFDIR/$CFG_TARGET.conf && " .
- "rm $CFG_SYSCONFDIR/$CFG_TARGET.conf.new");
- } else {
- notice("unable to open configuration file");
- }
- }
}
}