[apache2] 01/01: Warn when disabling essential modules, similar to apt when removing essential packages

Arno Töll atoell-guest at moszumanska.debian.org
Sun Jul 13 12:27:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

atoell-guest pushed a commit to branch master
in repository apache2.

commit 2d06849f7c419e078fb63cb83a275bcdc64b5c5f
Author: Arno Töll <arno at debian.org>
Date:   Sun Jul 13 01:26:43 2014 -1100

    Warn when disabling essential modules, similar to apt when removing essential packages
---
 debian/a2enmod   | 20 ++++++++++++++++++++
 debian/changelog |  7 +++++++
 2 files changed, 27 insertions(+)

diff --git a/debian/a2enmod b/debian/a2enmod
index 30884f7..23e3375 100755
--- a/debian/a2enmod
+++ b/debian/a2enmod
@@ -32,6 +32,9 @@ my $act        = $1;
 my $obj        = $2;
 my $dir_suffix = $3;
 
+my @essential_module_list = (qw/access_compat alias auth_basic authn_file/,
+    qw/authz_host authz_user autoindex deflate dir env filter logio/,
+    qw/mime negotiation setenvif unixd version watchdog/);
 my $env_file = $ENV{APACHE_ENVVARS}
     || (
     $ENV{APACHE_CONFDIR}
@@ -270,6 +273,9 @@ sub doit {
     }
     else {
         if ( -e $link || -l $link ) {
+            if ($obj eq 'module' && grep {$_ eq $acton} @essential_module_list) {
+                  $force || essential_module_handling($acton);
+            }
             remove_link($link);
             if ( $conflink && -e $conflink ) {
                 remove_link($conflink);
@@ -524,4 +530,18 @@ sub switch_marker {
     }
 }
 
+sub essential_module_handling {
+    my $module = shift;
+
+    print "WARNING: The following essential module will be disabled.\n";
+    print "This might result in unexpected behavior and should NOT be done\n";
+    print "unless you know exactly what you are doing!\n $module\n\n";
+    print "To continue type in the phrase 'Yes, do as I say!' or retry by passing '-f': ";
+    my $input = <STDIN>;
+    chomp($input);
+    if ($input ne 'Yes, do as I say!') {
+        print("Aborting\n");
+        exit(1)
+    }
+}
 # vim: syntax=perl sw=4 sts=4 sr et
diff --git a/debian/changelog b/debian/changelog
index 885919f..7fa697a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+apache2 (2.4.9-3) UNRELEASED; urgency=medium
+
+  * Warn users if they try to disable modules that we consider essential for
+    operation of the Apache web server (Closes: #709461)
+
+ -- Arno Töll <arno at debian.org>  Sun, 13 Jul 2014 01:25:26 -1100
+
 apache2 (2.4.9-2) unstable; urgency=medium
 
   * Fix logic in postinst to detect existing index.* files in both

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-apache/apache2.git



More information about the Pkg-apache-commits mailing list