From 5ad8ddb38da99e84001d59a370cc2c8e3f1c9785 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Tue, 13 Oct 2009 13:10:45 +0000 Subject: [PATCH 01/11] - Update to 2.3.4 - Upstream moved to apache.org - License changed to ASL 2.0 - Configuration directives have all been renamed - use fixconf.sed script to fix if necessary - Lots of documentation changes - Renumber sources - Don't defer to mod_fastcgi if both are present - Build SELinux policy module for EL-5; support in EL-5.3 is incomplete and will be fixed in EL-5.5 (#519369) - Drop aliases httpd_sys_content_r{a,o,w}_t -> httpd_fastcgi_content_r{a,o,w}_t from pre-2.5 SElinux policy module as these types aren't defined there - Drop gawk buildreq --- .cvsignore | 2 +- configuration.htm | 257 ------------------------ doc.htm | 210 ------------------- fastcgi.te | 8 +- fcgid.conf | 12 +- mod_fcgid-2.1-README.RPM | 13 +- mod_fcgid-2.1-README.SELinux | 3 +- mod_fcgid-2.3.4-fixconf-shellbang.patch | 8 + mod_fcgid.2.1-docurls.patch | 17 -- mod_fcgid.spec | 105 ++++++---- sources | 2 +- 11 files changed, 83 insertions(+), 554 deletions(-) delete mode 100644 configuration.htm delete mode 100644 doc.htm create mode 100644 mod_fcgid-2.3.4-fixconf-shellbang.patch delete mode 100644 mod_fcgid.2.1-docurls.patch diff --git a/.cvsignore b/.cvsignore index 64d7d91..3760558 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -mod_fcgid.2.2.tar.gz +mod_fcgid-2.3.4.tar.bz2 diff --git a/configuration.htm b/configuration.htm deleted file mode 100644 index 774334c..0000000 --- a/configuration.htm +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - The mod_fcgid Home Page - - -

This is a for regular fastcgi. 

-

LoadModule fcgid_module modules/mod_fcgid.so

-

<Location /fcgid>
-    SetHandler fcgid-script
-    Options ExecCGI
-    allow from all
-</Location>

-

  -

-
-

This is for suEXEC. Please get more -information about suEXEC here

-

LoadModule fcgid_module modules/mod_fcgid.so

-

<Location /fcgid>
-    SetHandler fcgid-script
-    Options ExecCGI
-    allow from all
-</Location>

-

<VirtualHost 192.168.1.89>
-    ServerAdmin webmaster@host.foo.com
-
    DocumentRoot /usr/local/apache2/htdocs/
-    ServerName host.foo.com
-    SuexecUserGroup pqf pqf
-</VirtualHost>

-

  -

-
-

This is for fastcgi-mode PHP (UNIX)

-

LoadModule fcgid_module modules/mod_fcgid.so

-

<Directory /usr/local/apache2/htdocs/php>
-    SetHandler fcgid-script
-    FCGIWrapper /usr/local/bin/php .php -

-

   # You need mod_fcgid -version >= 2.1 to support arguments in FCGIWrapper, if you want
-   # FCGIWrapper "/usr/local/bin/php -c /etc/" .php

-    Options ExecCGI
-

    allow from all
-</Directory>

-

This works too:

-

LoadModule fcgid_module modules/mod_fcgid.so 

-

AddHandler fcgid-script .php
-<Directory /usr/local/apache2/htdocs/php>
-    FCGIWrapper /usr/local/bin/php .php

-

    # You need mod_fcgid version >= 2.1 to -support arguments in FCGIWrapper, if you want
-   # FCGIWrapper "/usr/local/bin/php -c /etc/" .php

-

    Options ExecCGI
-    allow from all
-</Directory>

-

# Please make sure:
-# php is configured with --enable-fastcgi option
-# check error_log(with debug level), if any thing goes wrong

-

-
-

This is for fastcgi-mode Ruby on Rails ( Thank Andre Nathan giving -me this demo configuration )
-

-LoadModule fcgid_module modules/mod_fcgid.so
-SocketPath /tmp/fcgidsock
-SharememPath /tmp/fcgidshm
-DefaultInitEnv RAILS_ENV production
-
-<Directory /home/sneakymustard/tumble/public>
-    Options ExecCGI FollowSymLinks
-    AllowOverride AuthConfig Indexes Limit
-    Order allow,deny
-    Allow from all
-
-    AddHandler fcgid-script .fcgi

-

    # You need -mod_fcgid version >= 2.1 to support arguments "xxx/dispatch.fcgi" in -FCGIWrapper
-
    FCGIWrapper "/usr/bin/ruby -/home/sneakymustard/tumble/public/dispatch.fcgi" .fcgi
-
-    RewriteEngine On
-    RewriteRule ^$ index.html [QSA]
-    RewriteRule ^([^.]+)$ $1.html [QSA]
-    RewriteCond %{REQUEST_FILENAME} !-f
-    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
-</Directory>
-
-

- -

-
-

This is for suPHP  ( UNIX )

-

LoadModule fcgid_module modules/mod_fcgid.so
-
-<VirtualHost *:80>
-    ServerName test2.example.com
-    DocumentRoot -/usr/local/apache2/htdocs/test2.example.com/
-    SuexecUserGroup pqf pqf
-</VirtualHost>
-
-<Directory /usr/local/apache2/htdocs/test2.example.com/>
-    AddHandler fcgid-script .php
-    Options ExecCGI
-    allow from all
-    FCGIWrapper -/usr/local/apache2/htdocs/test2.example.com/php .php

-

-

    # You need mod_fcgid version >= 2.1 to -support arguments in FCGIWrapper, if you want
-   # FCGIWrapper "/usr/local/bin/php -c /etc/" .php

-

</Directory>

-

# Please make sure:
-# php is configured with --enable-fastcgi option
-# copy php execution to /usr/local/apache2/htdocs/test2.example.com/ -directory
-# make sure all files in /usr/local/apache2/htdocs/test2.example.com/ -with right owner and group
-# check error_log(with debug level) and suexec_log, if any thing goes -wrong

-

-
-


-This is for fastcgi-mode PHP ( Windows ) -

-

LoadModule fcgid_module modules/mod_fcgid.so
-DefaultInitEnv PHPRC "c:/php/"
-DefaultInitEnv PATH -"c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
-DefaultInitEnv SystemRoot "C:/Windows"
-DefaultInitEnv SystemDrive "C:"
-DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
-DefaultInitEnv TMP "C:/WINDOWS/TEMP"
-DefaultInitEnv windir "C:/WINDOWS"
-<Directory "C:/Apache2/htdocs/php/">
-    SetHandler fcgid-script
-    Options execCGI
-    AllowOverride None
-    Order allow,deny
-    Allow from all
-    FCGIWrapper "c:/php/php.exe" .php

-

    # You need mod_fcgid version >= 2.1 to -support arguments in FCGIWrapper, if you want
-   # FCGIWrapper "/usr/local/bin/php -c /etc/" .php

-</Directory>

-

This works too: -

-

LoadModule fcgid_module modules/mod_fcgid.so
-DefaultInitEnv PHPRC "c:/php/"
-DefaultInitEnv PATH -"c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
-DefaultInitEnv SystemRoot "C:/Windows"
-DefaultInitEnv SystemDrive "C:"
-DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
-DefaultInitEnv TMP "C:/WINDOWS/TEMP"
-DefaultInitEnv windir "C:/WINDOWS"
-AddHandler fcgid-script .php
-<Directory "C:/Apache2/htdocs/php/">
-    FCGIWrapper "c:/php/php.exe" .php

-

    # You need mod_fcgid version >= 2.1 to -support arguments in FCGIWrapper, if you want
-   # FCGIWrapper "/usr/local/bin/php -c /etc/" .php
-

-

     -Options ExecCGI
-    allow from all
-</Directory>
-

-
-

This is for Authenticator

-

LoadModule fcgid_module modules/mod_fcgid.so -

-

<Location /fcgid>
-SetHandler fcgid-script
-Options ExecCGI
-allow from all
-AuthType Basic
-AuthName ProtectedRealm
-FastCgiAuthenticator /some/path/authenticator
-require valid-user
-</Location>
-

-

Another configuration: FastCgiAuthenticatorAuthoritative -(default On)

-

Setting the FastCgiAuthenticatorAuthoritative -directive explicitly to Off allows authentication to be -passed on to lower level modules

-
-

This is for Authorizer

-

LoadModule fcgid_module modules/mod_fcgid.so -

-

<Location /fcgid>
-SetHandler fcgid-script
-Options ExecCGI
-allow from all
-AuthType Basic
-AuthName ProtectedRealm
-FastCgiAuthorizer /some/place/Authorizer
-</Location>

-

Another configuration: FastCgiAuthorizerAuthoritative -(default On)

-

Setting the FastCgiAuthorizerAuthoritative directive -explicitly to Off allows authorization to be passed on to -lower level modules

-
-

This is for AccessChecker

-

LoadModule fcgid_module modules/mod_fcgid.so -

-

<Location /fcgid>
-SetHandler fcgid-script
-Options ExecCGI
-allow from all
-FastCgiAccessChecker /some/place/access-checker
-</Location>
-

-

Another configuration: FastCgiAccessCheckerAuthoritative -(default On)

-

Setting the FastCgiAccessCheckerAuthoritative -directive explicitly to Off allows access checking to be -passed on to lower level modules

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

-

 

- - diff --git a/doc.htm b/doc.htm deleted file mode 100644 index 51b1c1a..0000000 --- a/doc.htm +++ /dev/null @@ -1,210 +0,0 @@ - - - - The mod_fcgid Home Page - - - - - - - - - - -
  - - - - - - -
Home
- Chinese Info
- Download (source)
- Documentations
- Feedback
- Support This Project
-
-
    -
  • -

    Here are some examples of configuration

    -
  • -
-

Configuration -for Regular fastcgi -(non-PHP, non-Ruby, non-Python) 

-

Configuration -for suEXEC fastcgi

-

Configuration for PHP -(UNIX)
-

-

Configuration for Ruby on -Rails
-

-

Configuration for suPHP -(UNIX)

-

Configuration -for PHP (Windows)

-

Configuration -for Authenticator

-

Configuration -for Authorizer

-

Configuration -for AccessChecker

-

 

-
-
    -
  • -

    There are -some other configurations you can set

    -
  • -
-

IdleTimeout n (300 -seconds)

-

An idle fastcgi application will be terminated after -IdleTimeout -seconds.

-

IdleScanInterval n (120 seconds)

-

The scan interval for idle -fastcgi applications.

-

BusyTimeout n (300 seconds)

-

a fastcgi -application will be terminated if handing a single request longer than -busy -timeout.

-

BusyScanInterval n (120 seconds)

-

The scan interval for busy -timeout fastcgi applications.

-

ErrorScanInterval n (3 seconds)

-

The -scan interval for exit pending fastcgi applications. fastcgi -applications will -be terminated within this scanning.

-

ZombieScanInterval n (3 seconds)

-

The -scan interval for zombie process. 

-

ProcessLifeTime n (3600 seconds)

-

A -fastcgi application will be terminated if lifetime expired, even no -error is -detected.

-

SocketPath path (logs/fcgidsock)

-

The directory to put the -UNIX domain socket. (UNIX only)
-

-

SharememPath path -(logs/fcgid_shm)
-

-

The share memory file path. (UNIX only) (version >= 2.1 -only)
-

-

SpawnScoreUpLimit n (10)

-

The -spawn-speed control score up water limit. Score increases while a -process is spawned or terminated, and decreases -as time progresses; while the score is higher than SpawnScoreUpLimit, -the spawning will be -held for a while. The higher this number is, the higher speed of the -spawning -can be.

-

SpawnScore n (1)

-

The weight of spawning.  This weight -will be plused to the spawn-control score on every spawn. The higher -this number -is, the lower speed of spawning can be.

-

TerminationScore n (2)

-

The -weight of termination. This weight will be plused to the score while -fastcgi -process terminates. The higher this number is, the lower speed of -spawning can -be.

-

MaxProcessCount n (1000)

-

The max count of total fastcgi process -count.

-

DefaultMaxClassProcessCount n (100)

-

The maximum number of -fastcgi application instances allowed to run for any one fastcgi -application. 

-

DefaultMinClassProcessCount n -(3)

-

The minimum number of -fastcgi application instances for any one fastcgi application. 

-

DefaultInitEnv  -env_name env_value

-

The default environment variables before a fastcgi -application is spawned. You can set this configuration more -than once.
-

- - - - - - -
Note: If you get:
-
Can't create TCP/IP -socket (10106) error while running PHP script(on Win32 only), you will have to set -these(Please modify the values if -necessary):
- DefaultInitEnv PHPRC "c:/php/"
-DefaultInitEnv PATH -"c:/php;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;"
-DefaultInitEnv SystemRoot "C:/Windows"
-DefaultInitEnv SystemDrive "C:"
-DefaultInitEnv TEMP "C:/WINDOWS/TEMP"
-DefaultInitEnv TMP "C:/WINDOWS/TEMP"
-DefaultInitEnv windir "C:/WINDOWS"
-
-(Thank Steffen of apachelounge.com for this note)
-
-
-


-

-

IPCConnectTimeout n (3 seconds)

-

The connect timeout to a -fastcgi application. 

-

IPCCommTimeout n (20 seconds)

-

The communication -timeout to a fastcgi application. Please increase this value if your -CGI have a -slow initialization or slow respond.

-

OutputBufferSize n (64k bytes)

-

CGI -output cache buffer size.

-

PHP_Fix_Pathinfo_Enable n(n=0/1, default 0)

-

If -you are using PHP and set cgi.fix_pathinfo=1 in php.ini, set -PHP_Fix_Pathinfo_Enable 1.

-

MaxRequestsPerProcess n (-1)

-

(Added in -version 1.11, patch from Robert L Mathews)

-

Adds a MaxRequestsPerProcess parameter that allows mod_fcgid -to -exit after handling a certain number of requests, similar to the -existing ProcessLifeTime option. 

-

This solves a problem with PHP in FastCGI mode. By default, -PHP stops -accepting new FastCGI connections after handling 500 requests; -unfortunately, there is a potential race condition during the PHP -cleanup code in which -PHP can be shutting down but still have the socket open, so mod_fcgid -under heavy load can send request number 501 to PHP and have it -"accepted", but then -PHP appears to simply exit, causing errors.

-

If you are using PHP, you should -set it to 500. -1 mean fastcgi process will not exit no matter how many -requests -it has handled.
-

-
- - diff --git a/fastcgi.te b/fastcgi.te index 68f1c13..373d920 100644 --- a/fastcgi.te +++ b/fastcgi.te @@ -8,16 +8,13 @@ # Previous versions of this policy module used a separate domain, httpd_fastcgi_script_t, # which is now an alias for httpd_sys_script_t. -policy_module(fastcgi, 0.1.10) +policy_module(fastcgi, 0.1.11) require { type devpts_t; type httpd_t; type httpd_log_t; type httpd_sys_content_t; - type httpd_sys_content_ra_t; - type httpd_sys_content_ro_t; - type httpd_sys_content_rw_t; type httpd_sys_script_exec_t; type httpd_sys_script_ra_t; type httpd_sys_script_ro_t; @@ -29,9 +26,6 @@ require { # Type aliases for contexts used with older policy modules typealias httpd_sys_content_t alias httpd_fastcgi_content_t; -typealias httpd_sys_content_ra_t alias httpd_fastcgi_content_ra_t; -typealias httpd_sys_content_ro_t alias httpd_fastcgi_content_ro_t; -typealias httpd_sys_content_rw_t alias httpd_fastcgi_content_rw_t; typealias httpd_sys_script_exec_t alias httpd_fastcgi_script_exec_t; typealias httpd_sys_script_ra_t alias httpd_fastcgi_script_ra_t; typealias httpd_sys_script_ro_t alias httpd_fastcgi_script_ro_t; diff --git a/fcgid.conf b/fcgid.conf index bf04642..90f208e 100644 --- a/fcgid.conf +++ b/fcgid.conf @@ -1,16 +1,14 @@ # This is the Apache server configuration file for providing FastCGI support # through mod_fcgid # -# Documentation is available at http://fastcgi.coremail.cn/doc.htm +# Documentation is available at +# http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html LoadModule fcgid_module modules/mod_fcgid.so # Use FastCGI to process .fcg .fcgi & .fpl scripts -# Don't do this if mod_fastcgi is present, as it will try to do the same thing - - AddHandler fcgid-script fcg fcgi fpl - +AddHandler fcgid-script fcg fcgi fpl # Sane place to put sockets and shared memory file -SocketPath /var/run/mod_fcgid -SharememPath /var/run/mod_fcgid/fcgid_shm +FcgidIPCDir /var/run/mod_fcgid +FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm diff --git a/mod_fcgid-2.1-README.RPM b/mod_fcgid-2.1-README.RPM index 18891e0..89165c5 100644 --- a/mod_fcgid-2.1-README.RPM +++ b/mod_fcgid-2.1-README.RPM @@ -3,15 +3,10 @@ Using the mod_fcgid RPM Package This mod_fcgid package includes a configuration file /etc/httpd/conf.d/fcgid.conf that ensures that the module is loaded and -added as the handler for .fcg, .fcgi, and .fpl applications (provided -mod_fastcgi in not already loaded, in which case you will need to decide which -module should handle which types of application). +added as the handler for .fcg, .fcgi, and .fpl applications. -So far the module package has only been tested in conjunction with the "moin" -wiki application. Further feedback regarding other applications is welcome. - -Setting up moin with mod_fcgid -============================== +Example: setting up moin with mod_fcgid +======================================= Setting up moin with mod_fcgid is very similar to setting it up as a regular CGI application. @@ -37,7 +32,7 @@ CGI application. /etc/httpd/conf.d/mywiki.conf # Wiki application data common to all wiki instances - Alias /moin_static182 "/usr/share/moin/htdocs/" + Alias /moin_static185 "/usr/share/moin/htdocs/" Options Indexes FollowSymLinks AllowOverride None diff --git a/mod_fcgid-2.1-README.SELinux b/mod_fcgid-2.1-README.SELinux index 1d4ff71..981cf59 100644 --- a/mod_fcgid-2.1-README.SELinux +++ b/mod_fcgid-2.1-README.SELinux @@ -4,8 +4,7 @@ Using mod_fcgid with SELinux in Fedora Core 5 / RHEL 5 onwards Versions of this package built for Fedora Core 5, 6, or 7 include an SELinux policy module to support FastCGI applications. Later Fedora releases and Red Hat Enterprise Linux 5.3 onwards include the policy in the main selinux-policy -package and do not require the separate module. This has only been tested so -far with moin, so feedback from other applications is welcome. +package and do not require the separate module. The module source (fastcgi.{fc,te}) is included for reference as documentation in the package. diff --git a/mod_fcgid-2.3.4-fixconf-shellbang.patch b/mod_fcgid-2.3.4-fixconf-shellbang.patch new file mode 100644 index 0000000..ea5fb50 --- /dev/null +++ b/mod_fcgid-2.3.4-fixconf-shellbang.patch @@ -0,0 +1,8 @@ +--- mod_fcgid-2.3.4/build/fixconf.sed 2009-10-07 04:16:08.000000000 +0100 ++++ mod_fcgid-2.3.4/build/fixconf.sed 2009-10-12 09:50:14.570448865 +0100 +@@ -1,4 +1,4 @@ +-#!/usr/bin/sed -f ++#!/bin/sed -f + # + # Licensed to the Apache Software Foundation (ASF) under one or more + # contributor license agreements. See the NOTICE file distributed with diff --git a/mod_fcgid.2.1-docurls.patch b/mod_fcgid.2.1-docurls.patch deleted file mode 100644 index a192ad4..0000000 --- a/mod_fcgid.2.1-docurls.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- mod_fcgid.2.1/directives.htm 2007-02-16 03:40:23.000000000 +0000 -+++ mod_fcgid.2.1/directives.htm 2007-02-16 10:45:44.000000000 +0000 -@@ -14,10 +14,10 @@ - - Home
-- Chinese Info
-- Download (source)
-- Documentations
-- Feedback
-+ Chinese Info
-+ Download (source)
-+ Documentations
-+ Feedback
- 7 +# RHEL 5.5 onwards will include policy in standard selinux-policy releases +%if 0%{?fedora}%{?rhel} < 5 || 0%{?fedora} > 7 %global selinux_module 0 %global selinux_types %{nil} %global selinux_variants %{nil} @@ -15,31 +15,30 @@ %endif Name: mod_fcgid -Version: 2.2 -Release: 13%{?dist} -Summary: Apache2 module for high-performance server-side scripting +Version: 2.3.4 +Release: 1%{?dist} +Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons -License: GPL+ -URL: http://fastcgi.coremail.cn/ -Source0: http://downloads.sf.net/mod-fcgid/mod_fcgid.%{version}.tar.gz +License: ASL 2.0 +URL: http://httpd.apache.org/mod_fcgid/ +Source0: http://www.apache.org/dist/httpd/mod_fcgid/mod_fcgid-%{version}.tar.bz2 Source1: fcgid.conf -Source2: fastcgi.te -Source3: fastcgi.fc -Source4: mod_fcgid-2.1-README.RPM -Source5: http://fastcgi.coremail.cn/doc.htm -Source6: http://fastcgi.coremail.cn/configuration.htm -Source7: mod_fcgid-2.1-README.SELinux -Source8: fastcgi-2.5.te -Patch0: mod_fcgid.2.1-docurls.patch +Source2: mod_fcgid-2.1-README.RPM +Source3: mod_fcgid-2.1-README.SELinux +Source10: fastcgi.te +Source11: fastcgi-2.5.te +Source12: fastcgi.fc +Patch0: mod_fcgid-2.3.4-fixconf-shellbang.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: gawk, httpd-devel >= 2.0, pkgconfig +BuildRequires: httpd-devel >= 2.0, pkgconfig Requires: httpd-mmn = %([ -a %{_includedir}/httpd/.mmn ] && %{__cat} %{_includedir}/httpd/.mmn || echo missing) # Make sure that selinux-policy is sufficiently up-to-date if it's installed -%if "%{?rhel}" == "5" -Conflicts: selinux-policy < 2.4.6-203.el5 -# No provide here because selinux-policy >= 2.4.6-203.el5 does the providing -Obsoletes: mod_fcgid-selinux <= %{version}-%{release} -%endif +## FastCGI policy properly incorporated into EL 5.5 (not yet available) +#%if "%{?rhel}" == "5" +#Conflicts: selinux-policy < 2.4.6-257.el5 +## No provide here because selinux-policy >= 2.4.6-203.el5 does the providing +#Obsoletes: mod_fcgid-selinux <= %{version}-%{release} +#%endif %if "%{?fedora}" == "8" Conflicts: selinux-policy < 3.0.8-123.fc8 %endif @@ -79,26 +78,23 @@ SELinux policy module supporting FastCGI applications with mod_fcgid. %endif %prep -%setup -q -n mod_fcgid.%{version} +%setup -q %{__cp} -p %{SOURCE1} fcgid.conf +%{__cp} -p %{SOURCE2} README.RPM +%{__cp} -p %{SOURCE3} README.SELinux %if 0%{?selinux_policynum} < 20501 -%{__cp} -p %{SOURCE2} fastcgi.te +%{__cp} -p %{SOURCE10} fastcgi.te %else -%{__cp} -p %{SOURCE8} fastcgi.te +%{__cp} -p %{SOURCE11} fastcgi.te %endif -%{__cp} -p %{SOURCE3} fastcgi.fc -%{__cp} -p %{SOURCE4} README.RPM -%{__cp} -p %{SOURCE5} directives.htm -%{__cp} -p %{SOURCE6} configuration.htm -%{__cp} -p %{SOURCE7} README.SELinux +%{__cp} -p %{SOURCE12} fastcgi.fc + +# Fix shellbang in fixconf script for our location of sed %patch0 -p1 -%{__sed} -i -e 's/\r$//' directives.htm configuration.htm -/usr/bin/iconv -f gb2312 -t utf8 < configuration.htm > configuration.htm.utf8 -%{__mv} -f configuration.htm.utf8 configuration.htm %build -topdir=$(/usr/bin/dirname $(/usr/sbin/apxs -q exp_installbuilddir)) -%{__make} top_dir=${topdir} +APXS=/usr/sbin/apxs ./configure.apxs +%{__make} %if %{selinux_module} for selinuxvariant in %{selinux_variants} do @@ -110,15 +106,13 @@ done %install %{__rm} -rf %{buildroot} -topdir=$(/usr/bin/dirname $(/usr/sbin/apxs -q exp_installbuilddir)) -%{__make} \ - top_dir=${topdir} \ - DESTDIR=%{buildroot} \ - MKINSTALLDIRS="%{__mkdir_p}" \ - install +%{__make} DESTDIR=%{buildroot} MKINSTALLDIRS="%{__mkdir_p}" install %{__install} -D -m 644 fcgid.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/fcgid.conf %{__install} -d -m 755 %{buildroot}%{_localstatedir}/run/mod_fcgid +# Include the manual as %doc, don't need it elsewhere +%{__rm} -rf %{buildroot}%{_var}/www/manual + # Install SELinux policy modules %if %{selinux_module} for selinuxvariant in %{selinux_variants} @@ -161,8 +155,10 @@ exit 0 %files %defattr(-,root,root,-) -%doc ChangeLog AUTHOR COPYING configuration.htm directives.htm -%doc README.RPM +# mod_fcgid.html.en is explicitly encoded as ISO-8859-1 +%doc CHANGES-FCGID LICENSE-FCGID NOTICE-FCGID README-FCGID STATUS-FCGID +%doc docs/manual/mod/mod_fcgid.html.en modules/fcgid/ChangeLog +%doc build/fixconf.sed %{_libdir}/httpd/modules/mod_fcgid.so %config(noreplace) %{_sysconfdir}/httpd/conf.d/fcgid.conf %dir %attr(0755,apache,apache) %{_localstatedir}/run/mod_fcgid/ @@ -175,6 +171,29 @@ exit 0 %endif %changelog +* Mon Oct 12 2009 Paul Howarth 2.3.4-1 +- Update to 2.3.4 (configuration directives changed again) +- Add fixconf.sed script for config file directives update + +* Fri Sep 25 2009 Paul Howarth 2.3.1-2.20090925svn818270 +- Update to svn revision 818270 +- DESTDIR and header detection patches upstreamed +- Build SELinux policy module for EL-5; support in EL-5.3 is incomplete and + will be fixed in EL-5.5 (#519369) +- Drop aliases httpd_sys_content_r{a,o,w}_t -> httpd_fastcgi_content_r{a,o,w}_t + from pre-2.5 SElinux policy module as these types aren't defined there + +* Wed Sep 23 2009 Paul Howarth 2.3.1-1.20090923svn817978 +- Update to post-2.3.1 svn snapshot +- Upstream moved to apache.org +- License changed to ASL 2.0 +- Use FCGID-prefixed config file options (old ones deprecated) +- Lots of documentation changes +- Renumber sources +- Don't defer to mod_fastcgi if both are present +- Drop gawk buildreq +- Add patches fixing RPM build issues (DESTDIR support, header detection) + * Sat Jul 25 2009 Fedora Release Engineering - 2.2-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild diff --git a/sources b/sources index 3ca1705..f2d8db5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ce7d7b16e69643dbd549d43d85025983 mod_fcgid.2.2.tar.gz +de1af384672a4bf719038e79be029c09 mod_fcgid-2.3.4.tar.bz2 From d745954d7297852419cdad5d1af64bdb36a65984 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Wed, 21 Oct 2009 13:30:53 +0000 Subject: [PATCH 02/11] Add fixes from upstream svn for a number of issues, most notably that the fixconf script had an error in the regexp, which resulted in a prefix of 'FcgidFcgid' on the updated directives --- mod_fcgid-2.3.4-svn827039.patch | 548 ++++++++++++++++++++++++++++++++ mod_fcgid.spec | 19 +- 2 files changed, 566 insertions(+), 1 deletion(-) create mode 100644 mod_fcgid-2.3.4-svn827039.patch diff --git a/mod_fcgid-2.3.4-svn827039.patch b/mod_fcgid-2.3.4-svn827039.patch new file mode 100644 index 0000000..9091106 --- /dev/null +++ b/mod_fcgid-2.3.4-svn827039.patch @@ -0,0 +1,548 @@ +Index: build/fixconf.sed +=================================================================== +--- build/fixconf.sed (revision 823071) ++++ build/fixconf.sed (working copy) +@@ -53,35 +53,35 @@ + s/^ZombieScanInterval/FcgidZombieScanInterval/g + # Next we fix all other occurences without matching + # the ones, that are already OK +-s/\([^D]\)BusyScanInterval/\1FcgidBusyScanInterval/g +-s/\([^D]\)BusyTimeout/\1FcgidBusyTimeout/g +-s/\([^D]\)DefaultInitEnv/\1FcgidInitialEnv/g +-s/\([^D]\)DefaultMaxClassProcessCount/\1FcgidMaxProcessesPerClass/g +-s/\([^D]\)DefaultMinClassProcessCount/\1FcgidMinProcessesPerClass/g +-s/\([^D]\)ErrorScanInterval/\1FcgidErrorScanInterval/g +-s/\([^D]\)FastCgiAccessChecker/\1FcgidAccessChecker/g +-s/\([^D]\)FastCgiAccessCheckerAuthoritative/\1FcgidAccessCheckerAuthoritative/g +-s/\([^D]\)FastCgiAuthenticator/\1FcgidAuthenticator/g +-s/\([^D]\)FastCgiAuthenticatorAuthoritative/\1FcgidAuthenticatorAuthoritative/g +-s/\([^D]\)FastCgiAuthorizer/\1FcgidAuthorizer/g +-s/\([^D]\)FastCgiAuthorizerAuthoritative/\1FcgidAuthorizerAuthoritative/g +-s/\([^D]\)FCGIWrapper/\1FcgidWrapper/g +-s/\([^D]\)IdleScanInterval/\1FcgidIdleScanInterval/g +-s/\([^D]\)IdleTimeout/\1FcgidIdleTimeout/g +-s/\([^D]\)IPCCommTimeout/\1FcgidIOTimeout/g +-s/\([^D]\)IPCConnectTimeout/\1FcgidConnectTimeout/g +-s/\([^D]\)MaxProcessCount/\1FcgidMaxProcesses/g +-s/\([^D]\)MaxRequestInMem/\1FcgidMaxRequestInMem/g +-s/\([^D]\)MaxRequestLen/\1FcgidMaxRequestLen/g +-s/\([^D]\)MaxRequestsPerProcess/\1FcgidMaxRequestsPerProcess/g +-s/\([^D]\)OutputBufferSize/\1FcgidOutputBufferSize/g +-s/\([^D]\)PassHeader/\1FcgidPassHeader/g +-s/\([^D]\)PHP_Fix_Pathinfo_Enable/\1FcgidFixPathinfo/g +-s/\([^D]\)ProcessLifeTime/\1FcgidProcessLifeTime/g +-s/\([^D]\)SharememPath/\1FcgidProcessTableFile/g +-s/\([^D]\)SocketPath/\1FcgidIPCDir/g +-s/\([^D]\)SpawnScore/\1FcgidSpawnScore/g +-s/\([^D]\)SpawnScoreUpLimit/\1FcgidSpawnScoreUpLimit/g +-s/\([^D]\)TerminationScore/\1FcgidTerminationScore/g +-s/\([^D]\)TimeScore/\1FcgidTimeScore/g +-s/\([^D]\)ZombieScanInterval/\1FcgidZombieScanInterval/g ++s/\([^d]\)BusyScanInterval/\1FcgidBusyScanInterval/g ++s/\([^d]\)BusyTimeout/\1FcgidBusyTimeout/g ++s/\([^d]\)DefaultInitEnv/\1FcgidInitialEnv/g ++s/\([^d]\)DefaultMaxClassProcessCount/\1FcgidMaxProcessesPerClass/g ++s/\([^d]\)DefaultMinClassProcessCount/\1FcgidMinProcessesPerClass/g ++s/\([^d]\)ErrorScanInterval/\1FcgidErrorScanInterval/g ++s/\([^d]\)FastCgiAccessChecker/\1FcgidAccessChecker/g ++s/\([^d]\)FastCgiAccessCheckerAuthoritative/\1FcgidAccessCheckerAuthoritative/g ++s/\([^d]\)FastCgiAuthenticator/\1FcgidAuthenticator/g ++s/\([^d]\)FastCgiAuthenticatorAuthoritative/\1FcgidAuthenticatorAuthoritative/g ++s/\([^d]\)FastCgiAuthorizer/\1FcgidAuthorizer/g ++s/\([^d]\)FastCgiAuthorizerAuthoritative/\1FcgidAuthorizerAuthoritative/g ++s/\([^d]\)FCGIWrapper/\1FcgidWrapper/g ++s/\([^d]\)IdleScanInterval/\1FcgidIdleScanInterval/g ++s/\([^d]\)IdleTimeout/\1FcgidIdleTimeout/g ++s/\([^d]\)IPCCommTimeout/\1FcgidIOTimeout/g ++s/\([^d]\)IPCConnectTimeout/\1FcgidConnectTimeout/g ++s/\([^d]\)MaxProcessCount/\1FcgidMaxProcesses/g ++s/\([^d]\)MaxRequestInMem/\1FcgidMaxRequestInMem/g ++s/\([^d]\)MaxRequestLen/\1FcgidMaxRequestLen/g ++s/\([^d]\)MaxRequestsPerProcess/\1FcgidMaxRequestsPerProcess/g ++s/\([^d]\)OutputBufferSize/\1FcgidOutputBufferSize/g ++s/\([^d]\)PassHeader/\1FcgidPassHeader/g ++s/\([^d]\)PHP_Fix_Pathinfo_Enable/\1FcgidFixPathinfo/g ++s/\([^d]\)ProcessLifeTime/\1FcgidProcessLifeTime/g ++s/\([^d]\)SharememPath/\1FcgidProcessTableFile/g ++s/\([^d]\)SocketPath/\1FcgidIPCDir/g ++s/\([^d]\)SpawnScore/\1FcgidSpawnScore/g ++s/\([^d]\)SpawnScoreUpLimit/\1FcgidSpawnScoreUpLimit/g ++s/\([^d]\)TerminationScore/\1FcgidTerminationScore/g ++s/\([^d]\)TimeScore/\1FcgidTimeScore/g ++s/\([^d]\)ZombieScanInterval/\1FcgidZombieScanInterval/g +Index: CHANGES-FCGID +=================================================================== +--- CHANGES-FCGID (revision 823071) ++++ CHANGES-FCGID (working copy) +@@ -1,4 +1,23 @@ + -*- coding: utf-8 -*- ++Changes with mod_fcgid 2.3.5 ++ ++ *) Fix a bug in fixconf.sed that resulted in a prefix of "FcgidFcgid" on the ++ updated directives. [Dan Hulme ] ++ ++ *) Fix possible corruption or truncation of request bodies which exceed ++ FcgidMaxRequestInMem. This is a regression since mod_fcgid 2.2, which ++ effectively ignored FcgidMaxRequestInMem if larger than 8K. PR 48021. ++ [Jeff Trawick] ++ ++ *) Fix handling of the request body when a FastCGI access checker/ ++ authenticator/authorizer (AAA) was configured. The body wasn't available ++ for the request handler. PR 47973. ++ [Jeff Trawick, Barry Scott ] ++ ++ *) Fix handling of FcgidCmdOptions so that it can apply to wrapper scripts ++ which were defined with command-line arguments on the FcgidWrapper ++ directive. [Jeff Trawick] ++ + Changes with mod_fcgid 2.3.4 + + *) Corrected unix 'make install' target regression in 2.3.3. [Jeff Trawick] +Index: docs/manual/mod/mod_fcgid.html.en +=================================================================== +--- docs/manual/mod/mod_fcgid.html.en (revision 823071) ++++ docs/manual/mod/mod_fcgid.html.en (working copy) +@@ -827,6 +827,9 @@ + FcgidMinProcessesPerClass. + A value of 0 disables the check.

+ ++

This idle timeout check is performed at the frequency of the configured ++ FcgidIdleScanInterval.

++ +

This setting will apply to all applications spawned for this + server or virtual host. Use + FcgidCmdOptions to apply +@@ -1077,6 +1080,9 @@ + FcgidMinProcessesPerClass. + A value of 0 disables the check.

+ ++

This process lifetime check is performed at the frequency of the configured ++ FcgidIdleScanInterval.

++ +

This setting will apply to all applications spawned for this + server or virtual host. Use + FcgidCmdOptions to apply +Index: docs/manual/mod/mod_fcgid.xml +=================================================================== +--- docs/manual/mod/mod_fcgid.xml (revision 823071) ++++ docs/manual/mod/mod_fcgid.xml (working copy) +@@ -778,6 +778,9 @@ + FcgidMinProcessesPerClass. + A value of 0 disables the check.

+ ++

This idle timeout check is performed at the frequency of the configured ++ FcgidIdleScanInterval.

++ +

This setting will apply to all applications spawned for this + server or virtual host. Use + FcgidCmdOptions to apply +@@ -969,6 +972,9 @@ + FcgidMinProcessesPerClass. + A value of 0 disables the check.

+ ++

This process lifetime check is performed at the frequency of the configured ++ FcgidIdleScanInterval.

++ +

This setting will apply to all applications spawned for this + server or virtual host. Use + FcgidCmdOptions to apply +Index: modules/fcgid/fcgid_proc_unix.c +=================================================================== +--- modules/fcgid/fcgid_proc_unix.c (revision 823071) ++++ modules/fcgid/fcgid_proc_unix.c (working copy) +@@ -259,6 +259,17 @@ + return errno; + } + ++ /* IPC directory permissions are safe, but avoid confusion */ ++ /* Not all flavors of unix use the current umask for AF_UNIX perms */ ++ ++ rv = apr_file_perms_set(unix_addr.sun_path, APR_FPROT_UREAD|APR_FPROT_UWRITE|APR_FPROT_UEXECUTE); ++ if (rv != APR_SUCCESS) { ++ ap_log_error(APLOG_MARK, APLOG_CRIT, rv, main_server, ++ "mod_fcgid: Couldn't set permissions on unix domain socket %s", ++ unix_addr.sun_path); ++ return rv; ++ } ++ + /* Listen the socket */ + if (listen(unix_socket, DEFAULT_FCGID_LISTENBACKLOG) < 0) { + ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, +@@ -747,8 +758,11 @@ + apr_size_t len; + const char* base; + if ((rv = apr_bucket_read(e, &base, &len, +- APR_BLOCK_READ)) != APR_SUCCESS) ++ APR_BLOCK_READ)) != APR_SUCCESS) { ++ ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, ipc_handle->request, ++ "mod_fcgid: can't read request from bucket"); + return rv; ++ } + + vec[nvec].iov_len = len; + vec[nvec].iov_base = (char*) base; +Index: modules/fcgid/fcgid_proc_win.c +=================================================================== +--- modules/fcgid/fcgid_proc_win.c (revision 823071) ++++ modules/fcgid/fcgid_proc_win.c (working copy) +@@ -59,7 +59,7 @@ + return APR_SUCCESS; + } + +-apr_status_t proc_spawn_process(char *wrapperpath, fcgid_proc_info *procinfo, ++apr_status_t proc_spawn_process(char *wrapper_cmdline, fcgid_proc_info *procinfo, + fcgid_procnode *procnode) + { + HANDLE *finish_event, listen_handle; +@@ -79,7 +79,7 @@ + + /* Build wrapper args */ + argc = 0; +- tmp = wrapperpath; ++ tmp = wrapper_cmdline; + while (1) { + word = ap_getword_white(procnode->proc_pool, &tmp); + if (word == NULL || *word == '\0') +@@ -165,7 +165,7 @@ + != APR_SUCCESS + || (rv = apr_procattr_dir_set(proc_attr, + ap_make_dirstr_parent(procnode->proc_pool, +- (wrapperpath && wrapperpath[0] != '\0') ++ (wrapper_cmdline && wrapper_cmdline[0] != '\0') + ? wargv[0] : procinfo->cgipath))) != APR_SUCCESS + || (rv = apr_procattr_cmdtype_set(proc_attr, APR_PROGRAM)) + != APR_SUCCESS +@@ -184,10 +184,10 @@ + } + + /* fork and exec now */ +- if (wrapperpath != NULL && wrapperpath[0] != '\0') { ++ if (wrapper_cmdline != NULL && wrapper_cmdline[0] != '\0') { + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, procinfo->main_server, + "mod_fcgid: call %s with wrapper %s", +- procinfo->cgipath, wrapperpath); ++ procinfo->cgipath, wrapper_cmdline); + if ((rv = apr_proc_create(procnode->proc_id, wargv[0], + wargv, proc_environ, proc_attr, + procnode->proc_pool)) != APR_SUCCESS) { +Index: modules/fcgid/fcgid_pm_main.c +=================================================================== +--- modules/fcgid/fcgid_pm_main.c (revision 823071) ++++ modules/fcgid/fcgid_pm_main.c (working copy) +@@ -531,9 +531,9 @@ + } + + /* Spawn the process now */ +- /* XXX Spawn uses wrapperpath, but log uses cgipath ? */ ++ /* XXX Spawn uses wrapper_cmdline, but log uses cgipath ? */ + if ((rv = +- proc_spawn_process(command->wrapperpath, &procinfo, ++ proc_spawn_process(command->wrapper_cmdline, &procinfo, + procnode)) != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_WARNING, rv, main_server, + "mod_fcgid: spawn process %s error", +Index: modules/fcgid/fcgid_conf.c +=================================================================== +--- modules/fcgid/fcgid_conf.c (revision 823071) ++++ modules/fcgid/fcgid_conf.c (working copy) +@@ -748,8 +748,11 @@ + apr_size_t cur_id; + } wrapper_id_info; + ++/* FIXME thread safety issues when FcgidWrapper is used in .htaccess; ++ * see use of pconf ++ */ + const char *set_wrapper_config(cmd_parms * cmd, void *dirconfig, +- const char *wrapperpath, ++ const char *wrapper_cmdline, + const char *extension, + const char *virtual) + { +@@ -760,13 +763,11 @@ + wrapper_id_info *id_info; + apr_size_t *wrapper_id; + fcgid_wrapper_conf *wrapper = NULL; ++ apr_pool_t *wrapper_conf_pool = cmd->server->process->pconf; /* bad */ + fcgid_dir_conf *config = (fcgid_dir_conf *) dirconfig; + + /* Sanity checks */ + +- if (wrapperpath == NULL) +- return "Invalid wrapper file"; +- + if (virtual == NULL && extension != NULL && !strcasecmp(extension, WRAPPER_FLAG_VIRTUAL)) { + virtual = WRAPPER_FLAG_VIRTUAL; + extension = NULL; +@@ -798,21 +799,21 @@ + apr_pool_cleanup_null, + cmd->server->process->pool); + } +- /* Get wrapper_id for wrapperpath */ ++ /* Get wrapper_id for wrapper_cmdline */ + if ((wrapper_id = +- apr_hash_get(id_info->wrapper_id_hash, wrapperpath, +- strlen(wrapperpath))) == NULL) { ++ apr_hash_get(id_info->wrapper_id_hash, wrapper_cmdline, ++ strlen(wrapper_cmdline))) == NULL) { + wrapper_id = + apr_pcalloc(cmd->server->process->pool, sizeof(*wrapper_id)); + *wrapper_id = id_info->cur_id++; +- apr_hash_set(id_info->wrapper_id_hash, wrapperpath, +- strlen(wrapperpath), wrapper_id); ++ apr_hash_set(id_info->wrapper_id_hash, wrapper_cmdline, ++ strlen(wrapper_cmdline), wrapper_id); + } + +- wrapper = apr_pcalloc(cmd->server->process->pconf, sizeof(*wrapper)); ++ wrapper = apr_pcalloc(wrapper_conf_pool, sizeof(*wrapper)); + + /* Get wrapper path */ +- tmp = wrapperpath; ++ tmp = wrapper_cmdline; + path = ap_getword_white(cmd->temp_pool, &tmp); + if (path == NULL || *path == '\0') + return "Invalid wrapper config"; +@@ -823,7 +824,9 @@ + return missing_file_msg(cmd->pool, "Wrapper", path, rv); + } + +- apr_cpystrn(wrapper->args, wrapperpath, _POSIX_PATH_MAX); ++ wrapper->exe = apr_pstrdup(wrapper_conf_pool, path); ++ /* FIXME no need to embed in structure (subject to correct pool usage) */ ++ apr_cpystrn(wrapper->args, wrapper_cmdline, _POSIX_PATH_MAX); + wrapper->inode = finfo.inode; + wrapper->deviceid = finfo.device; + wrapper->share_group_id = *wrapper_id; +Index: modules/fcgid/fcgid_pm_win.c +=================================================================== +--- modules/fcgid/fcgid_pm_win.c (revision 823071) ++++ modules/fcgid/fcgid_pm_win.c (working copy) +@@ -140,13 +140,13 @@ + command->virtualhost = r->server->server_hostname; + + /* Update fcgid_command with wrapper info */ +- command->wrapperpath[0] = '\0'; ++ command->wrapper_cmdline[0] = '\0'; + if ((wrapperconf = get_wrapper_info(argv0, r))) { +- apr_cpystrn(command->wrapperpath, wrapperconf->args, _POSIX_PATH_MAX); ++ apr_cpystrn(command->wrapper_cmdline, wrapperconf->args, _POSIX_PATH_MAX); + command->deviceid = wrapperconf->deviceid; + command->inode = wrapperconf->inode; + command->share_grp_id = wrapperconf->share_group_id; +- cmd_to_spawn = command->wrapperpath; ++ cmd_to_spawn = wrapperconf->exe; + } + else { + cmd_to_spawn = command->cgipath; +Index: modules/fcgid/fcgid_pm_unix.c +=================================================================== +--- modules/fcgid/fcgid_pm_unix.c (revision 823071) ++++ modules/fcgid/fcgid_pm_unix.c (working copy) +@@ -411,13 +411,13 @@ + command->virtualhost = r->server->server_hostname; + + /* Update fcgid_command with wrapper info */ +- command->wrapperpath[0] = '\0'; ++ command->wrapper_cmdline[0] = '\0'; + if ((wrapperconf = get_wrapper_info(argv0, r))) { +- apr_cpystrn(command->wrapperpath, wrapperconf->args, _POSIX_PATH_MAX); ++ apr_cpystrn(command->wrapper_cmdline, wrapperconf->args, _POSIX_PATH_MAX); + command->deviceid = wrapperconf->deviceid; + command->inode = wrapperconf->inode; + command->share_grp_id = wrapperconf->share_group_id; +- cmd_to_spawn = command->wrapperpath; ++ cmd_to_spawn = wrapperconf->exe; + } + else { + cmd_to_spawn = command->cgipath; +Index: modules/fcgid/fcgid_pm.h +=================================================================== +--- modules/fcgid/fcgid_pm.h (revision 823071) ++++ modules/fcgid/fcgid_pm.h (working copy) +@@ -22,7 +22,7 @@ + + typedef struct { + char cgipath[_POSIX_PATH_MAX]; +- char wrapperpath[_POSIX_PATH_MAX]; ++ char wrapper_cmdline[_POSIX_PATH_MAX]; + apr_ino_t inode; + dev_t deviceid; + apr_size_t share_grp_id; +Index: modules/fcgid/fcgid_bridge.c +=================================================================== +--- modules/fcgid/fcgid_bridge.c (revision 823071) ++++ modules/fcgid/fcgid_bridge.c (working copy) +@@ -376,8 +376,6 @@ + if ((rv = + proc_write_ipc(&bucket_ctx->ipc, + output_brigade)) != APR_SUCCESS) { +- ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, +- "mod_fcgid: error writing data to FastCGI server"); + bucket_ctx->has_error = 1; + return HTTP_INTERNAL_SERVER_ERROR; + } +@@ -437,39 +435,18 @@ + return cond_status; + } + +-int bridge_request(request_rec * r, int role, const char *argv0, +- fcgid_wrapper_conf * wrapper_conf) ++static int add_request_body(request_rec *r, apr_pool_t *request_pool, ++ apr_bucket_brigade *output_brigade) + { +- apr_pool_t *request_pool = r->main ? r->main->pool : r->pool; +- server_rec *s = r->server; +- fcgid_server_conf *sconf = ap_get_module_config(s->module_config, ++ apr_bucket *bucket_input, *bucket_header; ++ apr_file_t *fd = NULL; ++ apr_off_t cur_pos = 0, request_size = 0; ++ apr_status_t rv; ++ FCGI_Header *stdin_request_header; ++ fcgid_server_conf *sconf = ap_get_module_config(r->server->module_config, + &fcgid_module); +- apr_status_t rv = APR_SUCCESS; + int seen_eos; +- apr_off_t request_size = 0; +- apr_file_t *fd = NULL; +- int need_truncate = 1; +- apr_off_t cur_pos = 0; +- FCGI_Header *stdin_request_header; +- apr_bucket_brigade *output_brigade; +- apr_bucket *bucket_input, *bucket_header, *bucket_eos; +- char **envp = ap_create_environment(request_pool, +- r->subprocess_env); + +- /* Create brigade for the request to fastcgi server */ +- output_brigade = +- apr_brigade_create(request_pool, r->connection->bucket_alloc); +- +- /* Build the begin request and environ request, append them to output_brigade */ +- if (!build_begin_block +- (role, r, r->connection->bucket_alloc, output_brigade) +- || !build_env_block(r, envp, r->connection->bucket_alloc, +- output_brigade)) { +- ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, +- "mod_fcgid: can't build begin or env request"); +- return HTTP_INTERNAL_SERVER_ERROR; +- } +- + /* Stdin header and body */ + /* XXX HACK: I have to read all the request into memory before sending it + to fastcgi application server, this prevents slow clients from +@@ -548,6 +525,15 @@ + apr_pool_userdata_get(&tmp, fd_key, + r->connection->pool); + fd = tmp; ++ ++ if (fd != NULL) { ++ if ((rv = apr_file_trunc(fd, 0)) != APR_SUCCESS) { ++ ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, ++ "mod_fcgid: can't truncate existing " ++ "temporary file"); ++ return HTTP_INTERNAL_SERVER_ERROR; ++ } ++ } + } + + if (fd == NULL) { +@@ -574,12 +560,9 @@ + apr_pool_userdata_set((const void *) fd, fd_key, + apr_pool_cleanup_null, + r->connection->pool); +- } else if (need_truncate) { +- need_truncate = 0; +- apr_file_trunc(fd, 0); +- cur_pos = 0; + } +- // Write request to tmp file ++ ++ /* Write request to tmp file */ + if ((rv = + apr_file_write_full(fd, (const void *) data, len, + &wrote_len)) != APR_SUCCESS +@@ -589,7 +572,7 @@ + "mod_fcgid: can't write tmp file for stdin request"); + return HTTP_INTERNAL_SERVER_ERROR; + } +- // Create file bucket ++ /* Create file bucket */ + bucket_stdin = + apr_bucket_file_create(fd, cur_pos, len, r->pool, + r->connection->bucket_alloc); +@@ -640,6 +623,40 @@ + } + APR_BRIGADE_INSERT_TAIL(output_brigade, bucket_header); + ++ return 0; ++} ++ ++int bridge_request(request_rec * r, int role, const char *argv0, ++ fcgid_wrapper_conf * wrapper_conf) ++{ ++ apr_pool_t *request_pool = r->main ? r->main->pool : r->pool; ++ apr_bucket_brigade *output_brigade; ++ apr_bucket *bucket_eos; ++ char **envp = ap_create_environment(request_pool, ++ r->subprocess_env); ++ int rc; ++ ++ /* Create brigade for the request to fastcgi server */ ++ output_brigade = ++ apr_brigade_create(request_pool, r->connection->bucket_alloc); ++ ++ /* Build the begin request and environ request, append them to output_brigade */ ++ if (!build_begin_block ++ (role, r, r->connection->bucket_alloc, output_brigade) ++ || !build_env_block(r, envp, r->connection->bucket_alloc, ++ output_brigade)) { ++ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, ++ "mod_fcgid: can't build begin or env request"); ++ return HTTP_INTERNAL_SERVER_ERROR; ++ } ++ ++ if (role == FCGI_RESPONDER) { ++ rc = add_request_body(r, request_pool, output_brigade); ++ if (rc) { ++ return rc; ++ } ++ } ++ + /* The eos bucket now */ + bucket_eos = apr_bucket_eos_create(r->connection->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(output_brigade, bucket_eos); +Index: modules/fcgid/fcgid_conf.h +=================================================================== +--- modules/fcgid/fcgid_conf.h (revision 823071) ++++ modules/fcgid/fcgid_conf.h (working copy) +@@ -54,7 +54,8 @@ + } auth_conf; + + typedef struct { +- char args[_POSIX_PATH_MAX]; ++ const char *exe; /* executable file path */ ++ char args[_POSIX_PATH_MAX]; /* entire command line */ + apr_ino_t inode; + apr_dev_t deviceid; + apr_size_t share_group_id; +Index: modules/fcgid/fcgid_proc_unix.c +=================================================================== +--- modules/fcgid/fcgid_proc_unix.c (revision 827986) ++++ modules/fcgid/fcgid_proc_unix.c (working copy) +@@ -43,6 +43,17 @@ + #include "fcgid_pm.h" + #include "fcgid_spawn_ctl.h" + ++/* apr forward compatibility */ ++#ifndef APR_FPROT_UWRITE ++#define APR_FPROT_UWRITE APR_UWRITE ++#endif ++#ifndef APR_FPROT_UREAD ++#define APR_FPROT_UREAD APR_UREAD ++#endif ++#ifndef APR_FPROT_UEXECUTE ++#define APR_FPROT_UEXECUTE APR_UEXECUTE ++#endif ++ + #if MODULE_MAGIC_NUMBER_MAJOR < 20081201 + #define ap_unixd_config unixd_config + // #define ap_unixd_setup_child unixd_setup_child diff --git a/mod_fcgid.spec b/mod_fcgid.spec index a2d7bdc..0648114 100644 --- a/mod_fcgid.spec +++ b/mod_fcgid.spec @@ -16,7 +16,7 @@ Name: mod_fcgid Version: 2.3.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons License: ASL 2.0 @@ -29,6 +29,7 @@ Source10: fastcgi.te Source11: fastcgi-2.5.te Source12: fastcgi.fc Patch0: mod_fcgid-2.3.4-fixconf-shellbang.patch +Patch1: mod_fcgid-2.3.4-svn827039.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: httpd-devel >= 2.0, pkgconfig Requires: httpd-mmn = %([ -a %{_includedir}/httpd/.mmn ] && %{__cat} %{_includedir}/httpd/.mmn || echo missing) @@ -92,6 +93,17 @@ SELinux policy module supporting FastCGI applications with mod_fcgid. # Fix shellbang in fixconf script for our location of sed %patch0 -p1 +# * Fix regexp in fixconf script that resulted in a prefix of "FcgidFcgid" +# on the updated directives +# * Fix possible corruption or truncation of request bodies that exceed +# FcgidMaxRequestInMem (regression since mod_fcgid 2.2, which effectively +# ignored FcgidMaxRequestInMem if larger than 8K) +# * Fix handling of the request body when a FastCGI +# access checker/authenticator/authorizer (AAA) was configured +# * Fix handling of FcgidCmdOptions so that it can apply to wrapper scripts +# that were defined with command-line arguments on the FcgidWrapper directive +%patch1 -p0 + %build APXS=/usr/sbin/apxs ./configure.apxs %{__make} @@ -171,6 +183,11 @@ exit 0 %endif %changelog +* Wed Oct 21 2009 Paul Howarth 2.3.4-2 +- Add fixes from upstream svn for a number of issues, most notably that the + fixconf script had an error in the regexp, which resulted in a prefix of + "FcgidFcgid" on the updated directives + * Mon Oct 12 2009 Paul Howarth 2.3.4-1 - Update to 2.3.4 (configuration directives changed again) - Add fixconf.sed script for config file directives update From bc3ca73cd7e49c8cc4d24d2ef5e0db3ef1eee0f3 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Thu, 26 Nov 2009 01:38:36 +0000 Subject: [PATCH 03/11] Fix typo that causes a failure to update the common directory. (releng #2781) --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b9e5e98..f5079bf 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # Makefile for source rpm: mod_fcgid -# $Id$ +# $Id: Makefile,v 1.1 2006/09/06 13:07:43 pghmcfc Exp $ NAME := mod_fcgid SPECFILE = $(firstword $(wildcard *.spec)) define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done endef MAKEFILE_COMMON := $(shell $(find-makefile-common)) From 55027a05ade9b50a97991c85061c65fe10d79270 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 8 May 2010 02:00:02 +0000 Subject: [PATCH 04/11] Initialize branch EL-6 for mod_fcgid --- branch | 1 + 1 file changed, 1 insertion(+) create mode 100644 branch diff --git a/branch b/branch new file mode 100644 index 0000000..46381b9 --- /dev/null +++ b/branch @@ -0,0 +1 @@ +EL-6 From 704ecd7ce201dd81450f8fc72c956bb979df4ac8 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Tue, 11 May 2010 13:06:13 +0000 Subject: [PATCH 05/11] Update to 2.3.5 --- .cvsignore | 2 +- mod_fcgid-2.3.4-svn827039.patch | 548 -------------------------------- mod_fcgid.spec | 20 +- sources | 2 +- 4 files changed, 8 insertions(+), 564 deletions(-) delete mode 100644 mod_fcgid-2.3.4-svn827039.patch diff --git a/.cvsignore b/.cvsignore index 3760558..c661092 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -mod_fcgid-2.3.4.tar.bz2 +mod_fcgid-2.3.5.tar.bz2 diff --git a/mod_fcgid-2.3.4-svn827039.patch b/mod_fcgid-2.3.4-svn827039.patch deleted file mode 100644 index 9091106..0000000 --- a/mod_fcgid-2.3.4-svn827039.patch +++ /dev/null @@ -1,548 +0,0 @@ -Index: build/fixconf.sed -=================================================================== ---- build/fixconf.sed (revision 823071) -+++ build/fixconf.sed (working copy) -@@ -53,35 +53,35 @@ - s/^ZombieScanInterval/FcgidZombieScanInterval/g - # Next we fix all other occurences without matching - # the ones, that are already OK --s/\([^D]\)BusyScanInterval/\1FcgidBusyScanInterval/g --s/\([^D]\)BusyTimeout/\1FcgidBusyTimeout/g --s/\([^D]\)DefaultInitEnv/\1FcgidInitialEnv/g --s/\([^D]\)DefaultMaxClassProcessCount/\1FcgidMaxProcessesPerClass/g --s/\([^D]\)DefaultMinClassProcessCount/\1FcgidMinProcessesPerClass/g --s/\([^D]\)ErrorScanInterval/\1FcgidErrorScanInterval/g --s/\([^D]\)FastCgiAccessChecker/\1FcgidAccessChecker/g --s/\([^D]\)FastCgiAccessCheckerAuthoritative/\1FcgidAccessCheckerAuthoritative/g --s/\([^D]\)FastCgiAuthenticator/\1FcgidAuthenticator/g --s/\([^D]\)FastCgiAuthenticatorAuthoritative/\1FcgidAuthenticatorAuthoritative/g --s/\([^D]\)FastCgiAuthorizer/\1FcgidAuthorizer/g --s/\([^D]\)FastCgiAuthorizerAuthoritative/\1FcgidAuthorizerAuthoritative/g --s/\([^D]\)FCGIWrapper/\1FcgidWrapper/g --s/\([^D]\)IdleScanInterval/\1FcgidIdleScanInterval/g --s/\([^D]\)IdleTimeout/\1FcgidIdleTimeout/g --s/\([^D]\)IPCCommTimeout/\1FcgidIOTimeout/g --s/\([^D]\)IPCConnectTimeout/\1FcgidConnectTimeout/g --s/\([^D]\)MaxProcessCount/\1FcgidMaxProcesses/g --s/\([^D]\)MaxRequestInMem/\1FcgidMaxRequestInMem/g --s/\([^D]\)MaxRequestLen/\1FcgidMaxRequestLen/g --s/\([^D]\)MaxRequestsPerProcess/\1FcgidMaxRequestsPerProcess/g --s/\([^D]\)OutputBufferSize/\1FcgidOutputBufferSize/g --s/\([^D]\)PassHeader/\1FcgidPassHeader/g --s/\([^D]\)PHP_Fix_Pathinfo_Enable/\1FcgidFixPathinfo/g --s/\([^D]\)ProcessLifeTime/\1FcgidProcessLifeTime/g --s/\([^D]\)SharememPath/\1FcgidProcessTableFile/g --s/\([^D]\)SocketPath/\1FcgidIPCDir/g --s/\([^D]\)SpawnScore/\1FcgidSpawnScore/g --s/\([^D]\)SpawnScoreUpLimit/\1FcgidSpawnScoreUpLimit/g --s/\([^D]\)TerminationScore/\1FcgidTerminationScore/g --s/\([^D]\)TimeScore/\1FcgidTimeScore/g --s/\([^D]\)ZombieScanInterval/\1FcgidZombieScanInterval/g -+s/\([^d]\)BusyScanInterval/\1FcgidBusyScanInterval/g -+s/\([^d]\)BusyTimeout/\1FcgidBusyTimeout/g -+s/\([^d]\)DefaultInitEnv/\1FcgidInitialEnv/g -+s/\([^d]\)DefaultMaxClassProcessCount/\1FcgidMaxProcessesPerClass/g -+s/\([^d]\)DefaultMinClassProcessCount/\1FcgidMinProcessesPerClass/g -+s/\([^d]\)ErrorScanInterval/\1FcgidErrorScanInterval/g -+s/\([^d]\)FastCgiAccessChecker/\1FcgidAccessChecker/g -+s/\([^d]\)FastCgiAccessCheckerAuthoritative/\1FcgidAccessCheckerAuthoritative/g -+s/\([^d]\)FastCgiAuthenticator/\1FcgidAuthenticator/g -+s/\([^d]\)FastCgiAuthenticatorAuthoritative/\1FcgidAuthenticatorAuthoritative/g -+s/\([^d]\)FastCgiAuthorizer/\1FcgidAuthorizer/g -+s/\([^d]\)FastCgiAuthorizerAuthoritative/\1FcgidAuthorizerAuthoritative/g -+s/\([^d]\)FCGIWrapper/\1FcgidWrapper/g -+s/\([^d]\)IdleScanInterval/\1FcgidIdleScanInterval/g -+s/\([^d]\)IdleTimeout/\1FcgidIdleTimeout/g -+s/\([^d]\)IPCCommTimeout/\1FcgidIOTimeout/g -+s/\([^d]\)IPCConnectTimeout/\1FcgidConnectTimeout/g -+s/\([^d]\)MaxProcessCount/\1FcgidMaxProcesses/g -+s/\([^d]\)MaxRequestInMem/\1FcgidMaxRequestInMem/g -+s/\([^d]\)MaxRequestLen/\1FcgidMaxRequestLen/g -+s/\([^d]\)MaxRequestsPerProcess/\1FcgidMaxRequestsPerProcess/g -+s/\([^d]\)OutputBufferSize/\1FcgidOutputBufferSize/g -+s/\([^d]\)PassHeader/\1FcgidPassHeader/g -+s/\([^d]\)PHP_Fix_Pathinfo_Enable/\1FcgidFixPathinfo/g -+s/\([^d]\)ProcessLifeTime/\1FcgidProcessLifeTime/g -+s/\([^d]\)SharememPath/\1FcgidProcessTableFile/g -+s/\([^d]\)SocketPath/\1FcgidIPCDir/g -+s/\([^d]\)SpawnScore/\1FcgidSpawnScore/g -+s/\([^d]\)SpawnScoreUpLimit/\1FcgidSpawnScoreUpLimit/g -+s/\([^d]\)TerminationScore/\1FcgidTerminationScore/g -+s/\([^d]\)TimeScore/\1FcgidTimeScore/g -+s/\([^d]\)ZombieScanInterval/\1FcgidZombieScanInterval/g -Index: CHANGES-FCGID -=================================================================== ---- CHANGES-FCGID (revision 823071) -+++ CHANGES-FCGID (working copy) -@@ -1,4 +1,23 @@ - -*- coding: utf-8 -*- -+Changes with mod_fcgid 2.3.5 -+ -+ *) Fix a bug in fixconf.sed that resulted in a prefix of "FcgidFcgid" on the -+ updated directives. [Dan Hulme ] -+ -+ *) Fix possible corruption or truncation of request bodies which exceed -+ FcgidMaxRequestInMem. This is a regression since mod_fcgid 2.2, which -+ effectively ignored FcgidMaxRequestInMem if larger than 8K. PR 48021. -+ [Jeff Trawick] -+ -+ *) Fix handling of the request body when a FastCGI access checker/ -+ authenticator/authorizer (AAA) was configured. The body wasn't available -+ for the request handler. PR 47973. -+ [Jeff Trawick, Barry Scott ] -+ -+ *) Fix handling of FcgidCmdOptions so that it can apply to wrapper scripts -+ which were defined with command-line arguments on the FcgidWrapper -+ directive. [Jeff Trawick] -+ - Changes with mod_fcgid 2.3.4 - - *) Corrected unix 'make install' target regression in 2.3.3. [Jeff Trawick] -Index: docs/manual/mod/mod_fcgid.html.en -=================================================================== ---- docs/manual/mod/mod_fcgid.html.en (revision 823071) -+++ docs/manual/mod/mod_fcgid.html.en (working copy) -@@ -827,6 +827,9 @@ - FcgidMinProcessesPerClass. - A value of 0 disables the check.

- -+

This idle timeout check is performed at the frequency of the configured -+ FcgidIdleScanInterval.

-+ -

This setting will apply to all applications spawned for this - server or virtual host. Use - FcgidCmdOptions to apply -@@ -1077,6 +1080,9 @@ - FcgidMinProcessesPerClass. - A value of 0 disables the check.

- -+

This process lifetime check is performed at the frequency of the configured -+ FcgidIdleScanInterval.

-+ -

This setting will apply to all applications spawned for this - server or virtual host. Use - FcgidCmdOptions to apply -Index: docs/manual/mod/mod_fcgid.xml -=================================================================== ---- docs/manual/mod/mod_fcgid.xml (revision 823071) -+++ docs/manual/mod/mod_fcgid.xml (working copy) -@@ -778,6 +778,9 @@ - FcgidMinProcessesPerClass. - A value of 0 disables the check.

- -+

This idle timeout check is performed at the frequency of the configured -+ FcgidIdleScanInterval.

-+ -

This setting will apply to all applications spawned for this - server or virtual host. Use - FcgidCmdOptions to apply -@@ -969,6 +972,9 @@ - FcgidMinProcessesPerClass. - A value of 0 disables the check.

- -+

This process lifetime check is performed at the frequency of the configured -+ FcgidIdleScanInterval.

-+ -

This setting will apply to all applications spawned for this - server or virtual host. Use - FcgidCmdOptions to apply -Index: modules/fcgid/fcgid_proc_unix.c -=================================================================== ---- modules/fcgid/fcgid_proc_unix.c (revision 823071) -+++ modules/fcgid/fcgid_proc_unix.c (working copy) -@@ -259,6 +259,17 @@ - return errno; - } - -+ /* IPC directory permissions are safe, but avoid confusion */ -+ /* Not all flavors of unix use the current umask for AF_UNIX perms */ -+ -+ rv = apr_file_perms_set(unix_addr.sun_path, APR_FPROT_UREAD|APR_FPROT_UWRITE|APR_FPROT_UEXECUTE); -+ if (rv != APR_SUCCESS) { -+ ap_log_error(APLOG_MARK, APLOG_CRIT, rv, main_server, -+ "mod_fcgid: Couldn't set permissions on unix domain socket %s", -+ unix_addr.sun_path); -+ return rv; -+ } -+ - /* Listen the socket */ - if (listen(unix_socket, DEFAULT_FCGID_LISTENBACKLOG) < 0) { - ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, -@@ -747,8 +758,11 @@ - apr_size_t len; - const char* base; - if ((rv = apr_bucket_read(e, &base, &len, -- APR_BLOCK_READ)) != APR_SUCCESS) -+ APR_BLOCK_READ)) != APR_SUCCESS) { -+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, ipc_handle->request, -+ "mod_fcgid: can't read request from bucket"); - return rv; -+ } - - vec[nvec].iov_len = len; - vec[nvec].iov_base = (char*) base; -Index: modules/fcgid/fcgid_proc_win.c -=================================================================== ---- modules/fcgid/fcgid_proc_win.c (revision 823071) -+++ modules/fcgid/fcgid_proc_win.c (working copy) -@@ -59,7 +59,7 @@ - return APR_SUCCESS; - } - --apr_status_t proc_spawn_process(char *wrapperpath, fcgid_proc_info *procinfo, -+apr_status_t proc_spawn_process(char *wrapper_cmdline, fcgid_proc_info *procinfo, - fcgid_procnode *procnode) - { - HANDLE *finish_event, listen_handle; -@@ -79,7 +79,7 @@ - - /* Build wrapper args */ - argc = 0; -- tmp = wrapperpath; -+ tmp = wrapper_cmdline; - while (1) { - word = ap_getword_white(procnode->proc_pool, &tmp); - if (word == NULL || *word == '\0') -@@ -165,7 +165,7 @@ - != APR_SUCCESS - || (rv = apr_procattr_dir_set(proc_attr, - ap_make_dirstr_parent(procnode->proc_pool, -- (wrapperpath && wrapperpath[0] != '\0') -+ (wrapper_cmdline && wrapper_cmdline[0] != '\0') - ? wargv[0] : procinfo->cgipath))) != APR_SUCCESS - || (rv = apr_procattr_cmdtype_set(proc_attr, APR_PROGRAM)) - != APR_SUCCESS -@@ -184,10 +184,10 @@ - } - - /* fork and exec now */ -- if (wrapperpath != NULL && wrapperpath[0] != '\0') { -+ if (wrapper_cmdline != NULL && wrapper_cmdline[0] != '\0') { - ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, procinfo->main_server, - "mod_fcgid: call %s with wrapper %s", -- procinfo->cgipath, wrapperpath); -+ procinfo->cgipath, wrapper_cmdline); - if ((rv = apr_proc_create(procnode->proc_id, wargv[0], - wargv, proc_environ, proc_attr, - procnode->proc_pool)) != APR_SUCCESS) { -Index: modules/fcgid/fcgid_pm_main.c -=================================================================== ---- modules/fcgid/fcgid_pm_main.c (revision 823071) -+++ modules/fcgid/fcgid_pm_main.c (working copy) -@@ -531,9 +531,9 @@ - } - - /* Spawn the process now */ -- /* XXX Spawn uses wrapperpath, but log uses cgipath ? */ -+ /* XXX Spawn uses wrapper_cmdline, but log uses cgipath ? */ - if ((rv = -- proc_spawn_process(command->wrapperpath, &procinfo, -+ proc_spawn_process(command->wrapper_cmdline, &procinfo, - procnode)) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_WARNING, rv, main_server, - "mod_fcgid: spawn process %s error", -Index: modules/fcgid/fcgid_conf.c -=================================================================== ---- modules/fcgid/fcgid_conf.c (revision 823071) -+++ modules/fcgid/fcgid_conf.c (working copy) -@@ -748,8 +748,11 @@ - apr_size_t cur_id; - } wrapper_id_info; - -+/* FIXME thread safety issues when FcgidWrapper is used in .htaccess; -+ * see use of pconf -+ */ - const char *set_wrapper_config(cmd_parms * cmd, void *dirconfig, -- const char *wrapperpath, -+ const char *wrapper_cmdline, - const char *extension, - const char *virtual) - { -@@ -760,13 +763,11 @@ - wrapper_id_info *id_info; - apr_size_t *wrapper_id; - fcgid_wrapper_conf *wrapper = NULL; -+ apr_pool_t *wrapper_conf_pool = cmd->server->process->pconf; /* bad */ - fcgid_dir_conf *config = (fcgid_dir_conf *) dirconfig; - - /* Sanity checks */ - -- if (wrapperpath == NULL) -- return "Invalid wrapper file"; -- - if (virtual == NULL && extension != NULL && !strcasecmp(extension, WRAPPER_FLAG_VIRTUAL)) { - virtual = WRAPPER_FLAG_VIRTUAL; - extension = NULL; -@@ -798,21 +799,21 @@ - apr_pool_cleanup_null, - cmd->server->process->pool); - } -- /* Get wrapper_id for wrapperpath */ -+ /* Get wrapper_id for wrapper_cmdline */ - if ((wrapper_id = -- apr_hash_get(id_info->wrapper_id_hash, wrapperpath, -- strlen(wrapperpath))) == NULL) { -+ apr_hash_get(id_info->wrapper_id_hash, wrapper_cmdline, -+ strlen(wrapper_cmdline))) == NULL) { - wrapper_id = - apr_pcalloc(cmd->server->process->pool, sizeof(*wrapper_id)); - *wrapper_id = id_info->cur_id++; -- apr_hash_set(id_info->wrapper_id_hash, wrapperpath, -- strlen(wrapperpath), wrapper_id); -+ apr_hash_set(id_info->wrapper_id_hash, wrapper_cmdline, -+ strlen(wrapper_cmdline), wrapper_id); - } - -- wrapper = apr_pcalloc(cmd->server->process->pconf, sizeof(*wrapper)); -+ wrapper = apr_pcalloc(wrapper_conf_pool, sizeof(*wrapper)); - - /* Get wrapper path */ -- tmp = wrapperpath; -+ tmp = wrapper_cmdline; - path = ap_getword_white(cmd->temp_pool, &tmp); - if (path == NULL || *path == '\0') - return "Invalid wrapper config"; -@@ -823,7 +824,9 @@ - return missing_file_msg(cmd->pool, "Wrapper", path, rv); - } - -- apr_cpystrn(wrapper->args, wrapperpath, _POSIX_PATH_MAX); -+ wrapper->exe = apr_pstrdup(wrapper_conf_pool, path); -+ /* FIXME no need to embed in structure (subject to correct pool usage) */ -+ apr_cpystrn(wrapper->args, wrapper_cmdline, _POSIX_PATH_MAX); - wrapper->inode = finfo.inode; - wrapper->deviceid = finfo.device; - wrapper->share_group_id = *wrapper_id; -Index: modules/fcgid/fcgid_pm_win.c -=================================================================== ---- modules/fcgid/fcgid_pm_win.c (revision 823071) -+++ modules/fcgid/fcgid_pm_win.c (working copy) -@@ -140,13 +140,13 @@ - command->virtualhost = r->server->server_hostname; - - /* Update fcgid_command with wrapper info */ -- command->wrapperpath[0] = '\0'; -+ command->wrapper_cmdline[0] = '\0'; - if ((wrapperconf = get_wrapper_info(argv0, r))) { -- apr_cpystrn(command->wrapperpath, wrapperconf->args, _POSIX_PATH_MAX); -+ apr_cpystrn(command->wrapper_cmdline, wrapperconf->args, _POSIX_PATH_MAX); - command->deviceid = wrapperconf->deviceid; - command->inode = wrapperconf->inode; - command->share_grp_id = wrapperconf->share_group_id; -- cmd_to_spawn = command->wrapperpath; -+ cmd_to_spawn = wrapperconf->exe; - } - else { - cmd_to_spawn = command->cgipath; -Index: modules/fcgid/fcgid_pm_unix.c -=================================================================== ---- modules/fcgid/fcgid_pm_unix.c (revision 823071) -+++ modules/fcgid/fcgid_pm_unix.c (working copy) -@@ -411,13 +411,13 @@ - command->virtualhost = r->server->server_hostname; - - /* Update fcgid_command with wrapper info */ -- command->wrapperpath[0] = '\0'; -+ command->wrapper_cmdline[0] = '\0'; - if ((wrapperconf = get_wrapper_info(argv0, r))) { -- apr_cpystrn(command->wrapperpath, wrapperconf->args, _POSIX_PATH_MAX); -+ apr_cpystrn(command->wrapper_cmdline, wrapperconf->args, _POSIX_PATH_MAX); - command->deviceid = wrapperconf->deviceid; - command->inode = wrapperconf->inode; - command->share_grp_id = wrapperconf->share_group_id; -- cmd_to_spawn = command->wrapperpath; -+ cmd_to_spawn = wrapperconf->exe; - } - else { - cmd_to_spawn = command->cgipath; -Index: modules/fcgid/fcgid_pm.h -=================================================================== ---- modules/fcgid/fcgid_pm.h (revision 823071) -+++ modules/fcgid/fcgid_pm.h (working copy) -@@ -22,7 +22,7 @@ - - typedef struct { - char cgipath[_POSIX_PATH_MAX]; -- char wrapperpath[_POSIX_PATH_MAX]; -+ char wrapper_cmdline[_POSIX_PATH_MAX]; - apr_ino_t inode; - dev_t deviceid; - apr_size_t share_grp_id; -Index: modules/fcgid/fcgid_bridge.c -=================================================================== ---- modules/fcgid/fcgid_bridge.c (revision 823071) -+++ modules/fcgid/fcgid_bridge.c (working copy) -@@ -376,8 +376,6 @@ - if ((rv = - proc_write_ipc(&bucket_ctx->ipc, - output_brigade)) != APR_SUCCESS) { -- ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, -- "mod_fcgid: error writing data to FastCGI server"); - bucket_ctx->has_error = 1; - return HTTP_INTERNAL_SERVER_ERROR; - } -@@ -437,39 +435,18 @@ - return cond_status; - } - --int bridge_request(request_rec * r, int role, const char *argv0, -- fcgid_wrapper_conf * wrapper_conf) -+static int add_request_body(request_rec *r, apr_pool_t *request_pool, -+ apr_bucket_brigade *output_brigade) - { -- apr_pool_t *request_pool = r->main ? r->main->pool : r->pool; -- server_rec *s = r->server; -- fcgid_server_conf *sconf = ap_get_module_config(s->module_config, -+ apr_bucket *bucket_input, *bucket_header; -+ apr_file_t *fd = NULL; -+ apr_off_t cur_pos = 0, request_size = 0; -+ apr_status_t rv; -+ FCGI_Header *stdin_request_header; -+ fcgid_server_conf *sconf = ap_get_module_config(r->server->module_config, - &fcgid_module); -- apr_status_t rv = APR_SUCCESS; - int seen_eos; -- apr_off_t request_size = 0; -- apr_file_t *fd = NULL; -- int need_truncate = 1; -- apr_off_t cur_pos = 0; -- FCGI_Header *stdin_request_header; -- apr_bucket_brigade *output_brigade; -- apr_bucket *bucket_input, *bucket_header, *bucket_eos; -- char **envp = ap_create_environment(request_pool, -- r->subprocess_env); - -- /* Create brigade for the request to fastcgi server */ -- output_brigade = -- apr_brigade_create(request_pool, r->connection->bucket_alloc); -- -- /* Build the begin request and environ request, append them to output_brigade */ -- if (!build_begin_block -- (role, r, r->connection->bucket_alloc, output_brigade) -- || !build_env_block(r, envp, r->connection->bucket_alloc, -- output_brigade)) { -- ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, -- "mod_fcgid: can't build begin or env request"); -- return HTTP_INTERNAL_SERVER_ERROR; -- } -- - /* Stdin header and body */ - /* XXX HACK: I have to read all the request into memory before sending it - to fastcgi application server, this prevents slow clients from -@@ -548,6 +525,15 @@ - apr_pool_userdata_get(&tmp, fd_key, - r->connection->pool); - fd = tmp; -+ -+ if (fd != NULL) { -+ if ((rv = apr_file_trunc(fd, 0)) != APR_SUCCESS) { -+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, r, -+ "mod_fcgid: can't truncate existing " -+ "temporary file"); -+ return HTTP_INTERNAL_SERVER_ERROR; -+ } -+ } - } - - if (fd == NULL) { -@@ -574,12 +560,9 @@ - apr_pool_userdata_set((const void *) fd, fd_key, - apr_pool_cleanup_null, - r->connection->pool); -- } else if (need_truncate) { -- need_truncate = 0; -- apr_file_trunc(fd, 0); -- cur_pos = 0; - } -- // Write request to tmp file -+ -+ /* Write request to tmp file */ - if ((rv = - apr_file_write_full(fd, (const void *) data, len, - &wrote_len)) != APR_SUCCESS -@@ -589,7 +572,7 @@ - "mod_fcgid: can't write tmp file for stdin request"); - return HTTP_INTERNAL_SERVER_ERROR; - } -- // Create file bucket -+ /* Create file bucket */ - bucket_stdin = - apr_bucket_file_create(fd, cur_pos, len, r->pool, - r->connection->bucket_alloc); -@@ -640,6 +623,40 @@ - } - APR_BRIGADE_INSERT_TAIL(output_brigade, bucket_header); - -+ return 0; -+} -+ -+int bridge_request(request_rec * r, int role, const char *argv0, -+ fcgid_wrapper_conf * wrapper_conf) -+{ -+ apr_pool_t *request_pool = r->main ? r->main->pool : r->pool; -+ apr_bucket_brigade *output_brigade; -+ apr_bucket *bucket_eos; -+ char **envp = ap_create_environment(request_pool, -+ r->subprocess_env); -+ int rc; -+ -+ /* Create brigade for the request to fastcgi server */ -+ output_brigade = -+ apr_brigade_create(request_pool, r->connection->bucket_alloc); -+ -+ /* Build the begin request and environ request, append them to output_brigade */ -+ if (!build_begin_block -+ (role, r, r->connection->bucket_alloc, output_brigade) -+ || !build_env_block(r, envp, r->connection->bucket_alloc, -+ output_brigade)) { -+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, -+ "mod_fcgid: can't build begin or env request"); -+ return HTTP_INTERNAL_SERVER_ERROR; -+ } -+ -+ if (role == FCGI_RESPONDER) { -+ rc = add_request_body(r, request_pool, output_brigade); -+ if (rc) { -+ return rc; -+ } -+ } -+ - /* The eos bucket now */ - bucket_eos = apr_bucket_eos_create(r->connection->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(output_brigade, bucket_eos); -Index: modules/fcgid/fcgid_conf.h -=================================================================== ---- modules/fcgid/fcgid_conf.h (revision 823071) -+++ modules/fcgid/fcgid_conf.h (working copy) -@@ -54,7 +54,8 @@ - } auth_conf; - - typedef struct { -- char args[_POSIX_PATH_MAX]; -+ const char *exe; /* executable file path */ -+ char args[_POSIX_PATH_MAX]; /* entire command line */ - apr_ino_t inode; - apr_dev_t deviceid; - apr_size_t share_group_id; -Index: modules/fcgid/fcgid_proc_unix.c -=================================================================== ---- modules/fcgid/fcgid_proc_unix.c (revision 827986) -+++ modules/fcgid/fcgid_proc_unix.c (working copy) -@@ -43,6 +43,17 @@ - #include "fcgid_pm.h" - #include "fcgid_spawn_ctl.h" - -+/* apr forward compatibility */ -+#ifndef APR_FPROT_UWRITE -+#define APR_FPROT_UWRITE APR_UWRITE -+#endif -+#ifndef APR_FPROT_UREAD -+#define APR_FPROT_UREAD APR_UREAD -+#endif -+#ifndef APR_FPROT_UEXECUTE -+#define APR_FPROT_UEXECUTE APR_UEXECUTE -+#endif -+ - #if MODULE_MAGIC_NUMBER_MAJOR < 20081201 - #define ap_unixd_config unixd_config - // #define ap_unixd_setup_child unixd_setup_child diff --git a/mod_fcgid.spec b/mod_fcgid.spec index 0648114..509bf77 100644 --- a/mod_fcgid.spec +++ b/mod_fcgid.spec @@ -15,8 +15,8 @@ %endif Name: mod_fcgid -Version: 2.3.4 -Release: 2%{?dist} +Version: 2.3.5 +Release: 1%{?dist} Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons License: ASL 2.0 @@ -29,7 +29,6 @@ Source10: fastcgi.te Source11: fastcgi-2.5.te Source12: fastcgi.fc Patch0: mod_fcgid-2.3.4-fixconf-shellbang.patch -Patch1: mod_fcgid-2.3.4-svn827039.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: httpd-devel >= 2.0, pkgconfig Requires: httpd-mmn = %([ -a %{_includedir}/httpd/.mmn ] && %{__cat} %{_includedir}/httpd/.mmn || echo missing) @@ -93,17 +92,6 @@ SELinux policy module supporting FastCGI applications with mod_fcgid. # Fix shellbang in fixconf script for our location of sed %patch0 -p1 -# * Fix regexp in fixconf script that resulted in a prefix of "FcgidFcgid" -# on the updated directives -# * Fix possible corruption or truncation of request bodies that exceed -# FcgidMaxRequestInMem (regression since mod_fcgid 2.2, which effectively -# ignored FcgidMaxRequestInMem if larger than 8K) -# * Fix handling of the request body when a FastCGI -# access checker/authenticator/authorizer (AAA) was configured -# * Fix handling of FcgidCmdOptions so that it can apply to wrapper scripts -# that were defined with command-line arguments on the FcgidWrapper directive -%patch1 -p0 - %build APXS=/usr/sbin/apxs ./configure.apxs %{__make} @@ -183,6 +171,10 @@ exit 0 %endif %changelog +* Wed Jan 27 2010 Paul Howarth 2.3.5-1 +- Update to 2.3.5 (see CHANGES-FCGID for details) +- Drop upstream svn patch + * Wed Oct 21 2009 Paul Howarth 2.3.4-2 - Add fixes from upstream svn for a number of issues, most notably that the fixconf script had an error in the regexp, which resulted in a prefix of diff --git a/sources b/sources index f2d8db5..b5c65e1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -de1af384672a4bf719038e79be029c09 mod_fcgid-2.3.4.tar.bz2 +640a49c9ddf8596bd913835118b4a6aa mod_fcgid-2.3.5.tar.bz2 From a31b060b5374042d4f67546c43f900a78b17c0a1 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Tue, 8 Jun 2010 20:32:00 +0000 Subject: [PATCH 06/11] SELinux policy module not needed for RHEL-6 onwards --- mod_fcgid.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mod_fcgid.spec b/mod_fcgid.spec index 509bf77..ab69b5d 100644 --- a/mod_fcgid.spec +++ b/mod_fcgid.spec @@ -2,7 +2,7 @@ # Fedora 8 and 9 versions include policy in errata selinux-policy releases # Fedora 10 onwards include policy in standard selinux-policy releases # RHEL 5.5 onwards will include policy in standard selinux-policy releases -%if 0%{?fedora}%{?rhel} < 5 || 0%{?fedora} > 7 +%if 0%{?fedora}%{?rhel} < 5 || 0%{?fedora} > 7 || 0%{?rhel} > 5 %global selinux_module 0 %global selinux_types %{nil} %global selinux_variants %{nil} @@ -16,7 +16,7 @@ Name: mod_fcgid Version: 2.3.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons License: ASL 2.0 @@ -171,6 +171,9 @@ exit 0 %endif %changelog +* Tue Jun 8 2010 Paul Howarth 2.3.5-2 +- SELinux policy module not needed for RHEL-6 onwards + * Wed Jan 27 2010 Paul Howarth 2.3.5-1 - Update to 2.3.5 (see CHANGES-FCGID for details) - Drop upstream svn patch From c4de07e49320b3ac2957ca446f511f8e545a011b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 29 Jul 2010 03:32:14 +0000 Subject: [PATCH 07/11] dist-git conversion --- .cvsignore => .gitignore | 0 Makefile | 21 --------------------- branch | 1 - 3 files changed, 22 deletions(-) rename .cvsignore => .gitignore (100%) delete mode 100644 Makefile delete mode 100644 branch diff --git a/.cvsignore b/.gitignore similarity index 100% rename from .cvsignore rename to .gitignore diff --git a/Makefile b/Makefile deleted file mode 100644 index f5079bf..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: mod_fcgid -# $Id: Makefile,v 1.1 2006/09/06 13:07:43 pghmcfc Exp $ -NAME := mod_fcgid -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$d/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/branch b/branch deleted file mode 100644 index 46381b9..0000000 --- a/branch +++ /dev/null @@ -1 +0,0 @@ -EL-6 From a39696fbcfe8c164b6477b39a7c467b8d423a3b3 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Wed, 1 Dec 2010 14:47:59 +0000 Subject: [PATCH 08/11] Fix for /var/run on tmpfs (#656625) - Add /etc/tmpfiles.d/mod_fcgid.conf for builds on Fedora 15 onwards to support running with /var/run on tmpfs (#656625) --- mod_fcgid-tmpfs.conf | 1 + mod_fcgid.spec | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 mod_fcgid-tmpfs.conf diff --git a/mod_fcgid-tmpfs.conf b/mod_fcgid-tmpfs.conf new file mode 100644 index 0000000..1a4897a --- /dev/null +++ b/mod_fcgid-tmpfs.conf @@ -0,0 +1 @@ +d /var/run/mod_fcgid - apache apache diff --git a/mod_fcgid.spec b/mod_fcgid.spec index fe64693..3e7aad0 100644 --- a/mod_fcgid.spec +++ b/mod_fcgid.spec @@ -16,7 +16,7 @@ Name: mod_fcgid Version: 2.3.6 -Release: 1%{?dist} +Release: 2%{?dist} Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons License: ASL 2.0 @@ -25,6 +25,7 @@ Source0: http://www.apache.org/dist/httpd/mod_fcgid/mod_fcgid-%{version}.tar.bz2 Source1: fcgid.conf Source2: mod_fcgid-2.1-README.RPM Source3: mod_fcgid-2.1-README.SELinux +Source4: mod_fcgid-tmpfs.conf Source10: fastcgi.te Source11: fastcgi-2.5.te Source12: fastcgi.fc @@ -34,6 +35,10 @@ BuildRequires: httpd-devel >= 2.0, pkgconfig Requires: httpd-mmn = %([ -a %{_includedir}/httpd/.mmn ] && %{__cat} %{_includedir}/httpd/.mmn || echo missing) # sed required for fixconf script Requires: /bin/sed +# systemd-units needed for ownership of /etc/tmpfiles.d directory +%if 0%{?fedora} > 14 +Requires: systemd-units +%endif # Make sure that selinux-policy is sufficiently up-to-date if it's installed # FastCGI policy properly incorporated into EL 5.5 %if "%{?rhel}" == "5" @@ -115,6 +120,13 @@ done # Include the manual as %%doc, don't need it elsewhere %{__rm} -rf %{buildroot}%{_var}/www/manual +# Make sure /var/run/mod_fcgid exists at boot time for systems +# with /var/run on tmpfs (#656625) +%if 0%{?fedora} > 14 +%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/tmpfiles.d +%{__install} -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/tmpfiles.d/mod_fcgid.conf +%endif + # Install SELinux policy modules %if %{selinux_module} for selinuxvariant in %{selinux_variants} @@ -163,6 +175,9 @@ exit 0 %doc build/fixconf.sed %{_libdir}/httpd/modules/mod_fcgid.so %config(noreplace) %{_sysconfdir}/httpd/conf.d/fcgid.conf +%if 0%{?fedora} > 14 +%{_sysconfdir}/tmpfiles.d/mod_fcgid.conf +%endif %dir %attr(0755,apache,apache) %{_localstatedir}/run/mod_fcgid/ %if %{selinux_module} @@ -173,6 +188,10 @@ exit 0 %endif %changelog +* Wed Dec 1 2010 Paul Howarth 2.3.6-2 +- Add /etc/tmpfiles.d/mod_fcgid.conf for builds on Fedora 15 onwards to + support running with /var/run on tmpfs (#656625) + * Thu Nov 4 2010 Paul Howarth 2.3.6-1 - Update to 2.3.6 (see CHANGES-FCGID for full details) - Fix possible stack buffer overwrite (CVE-2010-3872) From dfe406f5f28a8f05918d80a7ccf3c8ac95e1d5b2 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 8 Feb 2011 13:51:17 -0600 Subject: [PATCH 09/11] - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild --- mod_fcgid.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod_fcgid.spec b/mod_fcgid.spec index 3e7aad0..3376e4f 100644 --- a/mod_fcgid.spec +++ b/mod_fcgid.spec @@ -16,7 +16,7 @@ Name: mod_fcgid Version: 2.3.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons License: ASL 2.0 @@ -188,6 +188,9 @@ exit 0 %endif %changelog +* Tue Feb 08 2011 Fedora Release Engineering - 2.3.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + * Wed Dec 1 2010 Paul Howarth 2.3.6-2 - Add /etc/tmpfiles.d/mod_fcgid.conf for builds on Fedora 15 onwards to support running with /var/run on tmpfs (#656625) From 83ce5a314c5ec48cd33900080f0888d49608ec29 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Fri, 6 Jan 2012 14:07:57 +0000 Subject: [PATCH 10/11] Nobody else likes macros for commands --- mod_fcgid.spec | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/mod_fcgid.spec b/mod_fcgid.spec index 3376e4f..42fef50 100644 --- a/mod_fcgid.spec +++ b/mod_fcgid.spec @@ -16,7 +16,7 @@ Name: mod_fcgid Version: 2.3.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons License: ASL 2.0 @@ -86,61 +86,61 @@ SELinux policy module supporting FastCGI applications with mod_fcgid. %prep %setup -q -%{__cp} -p %{SOURCE1} fcgid.conf -%{__cp} -p %{SOURCE2} README.RPM -%{__cp} -p %{SOURCE3} README.SELinux +cp -p %{SOURCE1} fcgid.conf +cp -p %{SOURCE2} README.RPM +cp -p %{SOURCE3} README.SELinux %if 0%{?selinux_policynum} < 20501 -%{__cp} -p %{SOURCE10} fastcgi.te +cp -p %{SOURCE10} fastcgi.te %else -%{__cp} -p %{SOURCE11} fastcgi.te +cp -p %{SOURCE11} fastcgi.te %endif -%{__cp} -p %{SOURCE12} fastcgi.fc +cp -p %{SOURCE12} fastcgi.fc # Fix shellbang in fixconf script for our location of sed %patch0 -p1 %build APXS=/usr/sbin/apxs ./configure.apxs -%{__make} +make %if %{selinux_module} for selinuxvariant in %{selinux_variants} do - %{__make} NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile - %{__mv} fastcgi.pp fastcgi.pp.${selinuxvariant} - %{__make} NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean + make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile + mv fastcgi.pp fastcgi.pp.${selinuxvariant} + make NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean done %endif %install -%{__rm} -rf %{buildroot} -%{__make} DESTDIR=%{buildroot} MKINSTALLDIRS="%{__mkdir_p}" install -%{__install} -D -m 644 fcgid.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/fcgid.conf -%{__install} -d -m 755 %{buildroot}%{_localstatedir}/run/mod_fcgid +rm -rf %{buildroot} +make DESTDIR=%{buildroot} MKINSTALLDIRS="mkdir -p" install +install -D -m 644 fcgid.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/fcgid.conf +install -d -m 755 %{buildroot}%{_localstatedir}/run/mod_fcgid # Include the manual as %%doc, don't need it elsewhere -%{__rm} -rf %{buildroot}%{_var}/www/manual +rm -rf %{buildroot}%{_var}/www/manual # Make sure /var/run/mod_fcgid exists at boot time for systems # with /var/run on tmpfs (#656625) %if 0%{?fedora} > 14 -%{__install} -d -m 755 %{buildroot}%{_sysconfdir}/tmpfiles.d -%{__install} -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/tmpfiles.d/mod_fcgid.conf +install -d -m 755 %{buildroot}%{_sysconfdir}/tmpfiles.d +install -p -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/tmpfiles.d/mod_fcgid.conf %endif # Install SELinux policy modules %if %{selinux_module} for selinuxvariant in %{selinux_variants} do - %{__install} -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} - %{__install} -p -m 644 fastcgi.pp.${selinuxvariant} \ + install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant} + install -p -m 644 fastcgi.pp.${selinuxvariant} \ %{buildroot}%{_datadir}/selinux/${selinuxvariant}/fastcgi.pp done # Hardlink identical policy module packages together -/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux +hardlink -cv %{buildroot}%{_datadir}/selinux %endif %clean -%{__rm} -rf %{buildroot} +rm -rf %{buildroot} %if %{selinux_module} %post selinux @@ -188,7 +188,10 @@ exit 0 %endif %changelog -* Tue Feb 08 2011 Fedora Release Engineering - 2.3.6-3 +* Fri Jan 6 2012 Paul Howarth 2.3.6-4 +- Nobody else likes macros for commands + +* Tue Feb 8 2011 Fedora Release Engineering 2.3.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Wed Dec 1 2010 Paul Howarth 2.3.6-2 From e662df910d6339faaadd147a43089e12e65e0741 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Sun, 22 Jan 2012 11:42:05 +0000 Subject: [PATCH 11/11] Fix for #783742 Fix regression in 2.3.6 that broke process controls when using vhost-specific configuration (upstream issue 49902, #783742) --- mod_fcgid-2.3.6-bz783742.patch | 16 ++++++++++++++++ mod_fcgid.spec | 11 ++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 mod_fcgid-2.3.6-bz783742.patch diff --git a/mod_fcgid-2.3.6-bz783742.patch b/mod_fcgid-2.3.6-bz783742.patch new file mode 100644 index 0000000..ee23631 --- /dev/null +++ b/mod_fcgid-2.3.6-bz783742.patch @@ -0,0 +1,16 @@ +This is an upstream patch for Apache Issue 49902, Fedora BZ#783742 + +Fix regression in 2.3.6 which broke process controls when using vhost- +specific configuration. + +--- httpd/mod_fcgid/trunk/modules/fcgid/fcgid_spawn_ctl.c 2010/11/22 14:08:25 1037726 ++++ httpd/mod_fcgid/trunk/modules/fcgid/fcgid_spawn_ctl.c 2010/11/22 14:08:29 1037727 +@@ -178,7 +178,7 @@ + if (current_node->inode == command->inode + && current_node->deviceid == command->deviceid + && !strcmp(current_node->cmdline, command->cmdline) +- && current_node->vhost_id == sconf->vhost_id ++ && current_node->vhost_id == command->vhost_id + && current_node->uid == command->uid + && current_node->gid == command->gid) + break; diff --git a/mod_fcgid.spec b/mod_fcgid.spec index 42fef50..bd96b25 100644 --- a/mod_fcgid.spec +++ b/mod_fcgid.spec @@ -16,7 +16,7 @@ Name: mod_fcgid Version: 2.3.6 -Release: 4%{?dist} +Release: 5%{?dist} Summary: FastCGI interface module for Apache 2 Group: System Environment/Daemons License: ASL 2.0 @@ -30,6 +30,7 @@ Source10: fastcgi.te Source11: fastcgi-2.5.te Source12: fastcgi.fc Patch0: mod_fcgid-2.3.4-fixconf-shellbang.patch +Patch1: mod_fcgid-2.3.6-bz783742.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: httpd-devel >= 2.0, pkgconfig Requires: httpd-mmn = %([ -a %{_includedir}/httpd/.mmn ] && %{__cat} %{_includedir}/httpd/.mmn || echo missing) @@ -99,6 +100,10 @@ cp -p %{SOURCE12} fastcgi.fc # Fix shellbang in fixconf script for our location of sed %patch0 -p1 +# Fix regression in 2.3.6 that broke process controls when +# using vhost-specific configuration (upstream fix) +%patch1 -p3 + %build APXS=/usr/sbin/apxs ./configure.apxs make @@ -188,6 +193,10 @@ exit 0 %endif %changelog +* Sun Jan 22 2012 Paul Howarth 2.3.6-5 +- Fix regression in 2.3.6 that broke process controls when using vhost-specific + configuration (upstream issue 49902, #783742) + * Fri Jan 6 2012 Paul Howarth 2.3.6-4 - Nobody else likes macros for commands