]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
PR 57379: If mod_cgi and mod_cgid get installed,
authorRainer Jung <rjung@apache.org>
Mon, 19 Jan 2015 10:32:51 +0000 (10:32 +0000)
committerRainer Jung <rjung@apache.org>
Mon, 19 Jan 2015 10:32:51 +0000 (10:32 +0000)
use IfModule for MPM to choose mod_cgi for
prefork and mod_cgid in all other cases.

Previously when combined with --enable-load-all-modules
both modules were loaded and it was undefined
which one actually handled cgi requests.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1652955 13f79535-47bb-0310-9956-ffa450edef68

Makefile.in

index 0f8cf8d51bca565518372ea903a17df3dc9265ad..fa8b3f0917217dc5b081f5fe7c8bdf9505756d2d 100644 (file)
@@ -58,6 +58,16 @@ install-conf:
                                        -e 's#@@SSLPort@@#$(SSLPORT)#g' \
                                        -e 'p' \
                                        < $$i; \
+                               if echo " $(DSO_MODULES) "|$(EGREP) " cgi " > /dev/null ; then \
+                                       have_cgi="1"; \
+                               else \
+                                       have_cgi="0"; \
+                               fi; \
+                               if echo " $(DSO_MODULES) "|$(EGREP) " cgid " > /dev/null ; then \
+                                       have_cgid="1"; \
+                               else \
+                                       have_cgid="0"; \
+                               fi; \
                                for j in $(DSO_MODULES) "^EOL^"; do \
                                        if test $$j != "^EOL^"; then \
                                                if echo ",$(ENABLED_DSO_MODULES),"|$(EGREP) ",$$j," > /dev/null ; then \
@@ -68,7 +78,17 @@ install-conf:
                                                if test "$(LOAD_ALL_MODULES)" = "yes"; then \
                                                        loading_disabled=""; \
                                                fi; \
+                                               if test $$j == "cgid" -a "$$have_cgi" == "1"; then \
+                                               echo "<IfModule !mpm_prefork_module>"; \
+                                               echo "    $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
+                                               echo "</IfModule>"; \
+                                               elif test $$j == "cgi" -a "$$have_cgid" == "1"; then \
+                                               echo "<IfModule mpm_prefork_module>"; \
+                                               echo "    $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
+                                               echo "</IfModule>"; \
+                                               else \
                                                echo "$${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
+                                               fi; \
                                        fi; \
                                done; \
                                sed -e '1,/@@LoadModule@@/d' \