File libapache-mod-fastcgi_2.4.7~0910052141-1.1.patch of Package apache2-mod_fastcgi

diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/changelog /build/suse/ceph-mod_fastcgi/debian/changelog
--- mod_fastcgi-SNAP-0910052141/debian/changelog	2003-11-13 03:15:18.000000000 +0100
+++ ceph-mod_fastcgi/debian/changelog	2014-07-17 00:09:48.398498450 +0200
@@ -1,10 +1,99 @@
-libapache-mod-fastcgi (2.4.1) unstable; urgency=low
+libapache-mod-fastcgi (2.4.7~0910052141-1) unstable; urgency=low
 
-  * Debian builds adopted by upstream.  See the CHANGES file for a
-    list of changes since the last release.  Patches from the Debian
-    project most welcome :-)
+  * New upstream release
 
- -- Sam Vilain <sam@vilain.net>  Thu, 13 Nov 2003 02:00:37 +0000
+ -- Tatsuki Sugiura <sugi@nemui.org>  Mon, 15 Nov 2010 16:31:58 +0900
+
+libapache-mod-fastcgi (2.4.6-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Tue, 18 Mar 2008 11:23:42 +0900
+
+libapache-mod-fastcgi (2.4.2-10) unstable; urgency=low
+
+  * Drop apache1.3 module. (Closes: #429095)
+  * Now this cannot be built with apache2.0.
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Mon, 28 Jan 2008 15:17:58 +0900
+
+libapache-mod-fastcgi (2.4.2-9) unstable; urgency=low
+
+  * apply authn provider patch for apache2.2.
+    Thanks for Martin Furter (Closes: #414185)
+  * stop build apache 1.3 binary (Closes: #429095)
+  * fix suexec wrapper path (Closes: #415913)
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Sat, 25 Aug 2007 17:13:50 +0900
+
+libapache-mod-fastcgi (2.4.2-8) unstable; urgency=high
+
+  * transit libapache2-mod-fastcgi for apache2.2
+  * Fix in built-in suexec path (Closes: #331617)
+  * remove unnecessary libc6 version dependency (Closes: #343519)
+  * apply patch to fix that apache2 segv on load (Closes: #343514)
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Fri,  6 Oct 2006 20:53:21 +0900
+
+libapache-mod-fastcgi (2.4.2-7) unstable; urgency=low
+
+  * Update description. Thanks for Russ Allbery. (Closes: #320246)
+  * a2{en,dis}cmd automatically called in postinst/prerm. (Closes: #320246)
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Sat,  6 Aug 2005 14:18:30 +0900
+
+libapache-mod-fastcgi (2.4.2-6) unstable; urgency=low
+
+  * fix typo in original document (Closes: #288270)
+  * add config topic in README.Debian (Closes: #298819)
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Wed, 16 Mar 2005 22:27:02 +0900
+
+libapache-mod-fastcgi (2.4.2-5) unstable; urgency=high
+
+  * SuEXEC setting has been disabled in defualt. (Closes: #275201)
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Tue, 19 Oct 2004 13:38:17 +0900
+
+libapache-mod-fastcgi (2.4.2-4) unstable; urgency=low
+
+  * Add Documentation
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Wed,  8 Sep 2004 18:15:05 +0900
+
+libapache-mod-fastcgi (2.4.2-3) unstable; urgency=high
+
+  * Back out the ill-fated apache2 LFS transition.
+  * Bump the apache2-{threaded,prefork}-dev build-dep to (>= 2.0.50-10)
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Tue, 24 Aug 2004 22:44:11 +0900
+
+libapache-mod-fastcgi (2.4.2-2) unstable; urgency=medium
+
+  * rebuild for new ABI of apache2 2.0.50-9
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Tue, 17 Aug 2004 15:08:04 +0900
+
+libapache-mod-fastcgi (2.4.2-1) unstable; urgency=low
+
+  * Upstream Release.
+  * New Maintainer (Closes: #229214)
+
+ -- Tatsuki Sugiura <sugi@nemui.org>  Sat, 24 Jul 2004 06:07:47 +0900
+
+libapache-mod-fastcgi (2.4.0-4) unstable; urgency=low
+
+  * QA upload.
+  * libdb4.1-dev build-dependency removed. (Closes: #243017)
+  * Standards-Version updated.
+
+ -- Emanuele Rocca <ema@debian.org>  Tue, 13 Apr 2004 18:09:33 +0200
+
+libapache-mod-fastcgi (2.4.0-3) unstable; urgency=low
+
+  * Orphaned.
+
+ -- Davide Puricelli (evo) <evo@debian.org>  Fri, 23 Jan 2004 19:15:54 +0100
 
 libapache-mod-fastcgi (2.4.0-2) unstable; urgency=low
 
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/control ceph-mod_fastcgi/debian/control
--- mod_fastcgi-SNAP-0910052141/debian/control	2003-11-13 03:15:19.000000000 +0100
+++ ceph-mod_fastcgi/debian/control	2014-07-08 14:28:33.184628874 +0200
@@ -1,18 +1,20 @@
 Source: libapache-mod-fastcgi
 Section: non-free/web
 Priority: optional
-Maintainer: Sam Vilain <sam@vilain.net>
-Standards-Version: 3.5.8.0
-Build-Depends: apache-dev (>= 1.3.0), debhelper (>> 3.0.0), lynx, libdb2-dev
+Maintainer: Tatsuki Sugiura <sugi@nemui.org>
+Standards-Version: 3.9.1
+Build-Depends: debhelper (>> 5.0.0), cdbs, apache2-threaded-dev (>= 2.2.4) | apache2-prefork-dev (>= 2.2.4), dpatch (>= 2.0.0), libtool, libapr1-dev, pkg-config
+Uploaders: Taku YASUI <tach@debian.or.jp>
+Homepage: http://www.fastcgi.com/
 
-Package: libapache-mod-fastcgi
+Package: libapache2-mod-fastcgi
 Architecture: any
-Depends: apache-common (>= 1.3.0), ${shlibs:Depends}
-Description: FastCGI module for Apache
- This package contains a FastCGI module for the Apache (1.3) web
- server.
- .
- FastCGI is an open standard for communicating between a web server
- and a web application, supported by many free and closed source web
- servers.  It provides CGI-like functionality, without the need to
- program to a particular server API.
+Depends: apache2.2-common (>= 2.2.4), ${shlibs:Depends}, ${misc:Depends}
+Description: Apache 2 FastCGI module for long-running CGI scripts
+ This is a FastCGI module for the Apache 2.x web server.  FastCGI is an
+ open standard for communicating between a web server and a long-running
+ web application.  CGI scripts supporting FastCGI can be started as a
+ daemon and process multiple requests without restarting.  This is
+ particularly useful for scripts written in languages like Perl, as it
+ saves the cost of recompiling the scripts and its loaded modules with
+ each invocation.
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/copyright ceph-mod_fastcgi/debian/copyright
--- mod_fastcgi-SNAP-0910052141/debian/copyright	2003-11-13 03:15:19.000000000 +0100
+++ ceph-mod_fastcgi/debian/copyright	2014-07-08 14:28:33.184628874 +0200
@@ -5,6 +5,24 @@
 
 Copyright:
 
+ Copyright (c) 1995-1996 Open Market, Inc.
+
+Authors:
+
+ *  Patches for Apache-1.1 provided by
+    Ralf S. Engelschall
+    <rse@en.muc.de>
+ *  Patches for Linux provided by
+    Scott Langley
+    <langles@vote-smart.org>
+ *  Patches for suexec handling by
+    Brian Grossman <brian@SoftHome.net> and
+    Rob Saccoccio <robs@ipass.net>
+
+--------------------------------------------------------------------
+ mod_fastcgi license terms
+--------------------------------------------------------------------
+
 This FastCGI application library source and object code (the
 "Software") and its documentation (the "Documentation") are
 copyrighted by Open Market, Inc ("Open Market").  The following terms
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/fastcgi.conf2 ceph-mod_fastcgi/debian/fastcgi.conf2
--- mod_fastcgi-SNAP-0910052141/debian/fastcgi.conf2	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/fastcgi.conf2	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,5 @@
+<IfModule mod_fastcgi.c>
+  AddHandler fastcgi-script .fcgi
+  #FastCgiWrapper /usr/lib/apache2/suexec
+  FastCgiIpcDir /var/lib/apache2/fastcgi
+</IfModule>
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/fastcgi.load ceph-mod_fastcgi/debian/fastcgi.load
--- mod_fastcgi-SNAP-0910052141/debian/fastcgi.load	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/fastcgi.load	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1 @@
+LoadModule fastcgi_module /usr/lib/apache2/modules/mod_fastcgi.so
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/libapache2-mod-fastcgi.docs ceph-mod_fastcgi/debian/libapache2-mod-fastcgi.docs
--- mod_fastcgi-SNAP-0910052141/debian/libapache2-mod-fastcgi.docs	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/libapache2-mod-fastcgi.docs	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1 @@
+docs/mod_fastcgi.html
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/libapache2-mod-fastcgi.postinst ceph-mod_fastcgi/debian/libapache2-mod-fastcgi.postinst
--- mod_fastcgi-SNAP-0910052141/debian/libapache2-mod-fastcgi.postinst	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/libapache2-mod-fastcgi.postinst	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,50 @@
+#! /bin/sh
+# postinst script for libapache-mod-fastcgi
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+# quoting from the policy:
+#     Any necessary prompting should almost always be confined to the
+#     post-installation script, and should be protected with a conditional
+#     so that unnecessary prompting doesn't happen if a package's
+#     installation fails and the `postinst' is called with `abort-upgrade',
+#     `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+    configure)
+	test ! -e /etc/apache2/mods-enabled/fcgid.load \
+	  -a ! -e /etc/apache2/mods-enabled/fastcgi.load \
+	  && a2enmod fastcgi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/libapache2-mod-fastcgi.prerm ceph-mod_fastcgi/debian/libapache2-mod-fastcgi.prerm
--- mod_fastcgi-SNAP-0910052141/debian/libapache2-mod-fastcgi.prerm	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/libapache2-mod-fastcgi.prerm	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,41 @@
+#! /bin/sh
+# postrm script for libapache-mod-fastcgi
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+       remove)
+        test -e /etc/apache2/mods-enabled/fastcgi.load && a2dismod fastcgi
+        ;;
+       purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+
+        ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/libapache2-mod-fastcgi.README.Debian ceph-mod_fastcgi/debian/libapache2-mod-fastcgi.README.Debian
--- mod_fastcgi-SNAP-0910052141/debian/libapache2-mod-fastcgi.README.Debian	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/libapache2-mod-fastcgi.README.Debian	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,29 @@
+
+Config Tips
+----------------------
+
+ * How to run your FastCGI app
+
+   In case that FastCGI script has ".fcgi" suffix, you just put the script
+   in /usr/lib/cgi-bin (or other directory has "+ExecCGI") and can run it.
+
+ * Using non-".fcgi" suffix
+
+   If your app have non-".fcgi" suffix, add AddHandler/SetHandler to httpd.conf.
+   For exapmple;
+   ---
+     <Directory /var/www/myfcgiapp>
+       AddHandler fastcgi-script .yourext .pl .rb .cgi .sh
+     </Directory>
+   ---
+
+ * How to run under SuExec
+
+   make enable following line;
+     #FastCgiWrapper /usr/lib/apache2/suexec
+   in /etc/apache2/mods-enabled/fastcgi.conf
+
+ * If you change apache's uid
+
+   You need to change owner of /var/lib/apache*/fastcgi to uid of apache run.
+
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/patches/00list ceph-mod_fastcgi/debian/patches/00list
--- mod_fastcgi-SNAP-0910052141/debian/patches/00list	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/patches/00list	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,4 @@
+#apache2-segv-on-load.dpatch # fixed
+#apache2.2-authn.dpatch # fixed
+#apache2.2-compat.dpatch # fixed
+doc-misc-typo-fix.dpatch
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/patches/apache2.2-authn.dpatch ceph-mod_fastcgi/debian/patches/apache2.2-authn.dpatch
--- mod_fastcgi-SNAP-0910052141/debian/patches/apache2.2-authn.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/patches/apache2.2-authn.dpatch	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,114 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## apache2.2-authn.dpatch by  <sugi@nemui.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: mod_fastcgi works as AUTHN provider for apache 2.2
+## 
+
+@DPATCH@
+diff -urNad libapache-mod-fastcgi~/mod_fastcgi.c libapache-mod-fastcgi/mod_fastcgi.c
+--- libapache-mod-fastcgi~/mod_fastcgi.c	2006-10-06 21:55:39.000000000 +0900
++++ libapache-mod-fastcgi/mod_fastcgi.c	2007-08-25 16:51:25.000000000 +0900
+@@ -82,6 +82,10 @@
+ 
+ #include "unixd.h"
+ 
++#ifdef APACHE22
++#include "mod_auth.h"
++#endif
++
+ #endif
+ #endif
+ 
+@@ -2657,10 +2661,15 @@
+     r->status_line = NULL;
+ }
+ 
++#ifdef APACHE22
++static authn_status check_user_authentication(request_rec *r, const char *user, const char *password)
++{
++#else /* !APACHE22 */
+ static int check_user_authentication(request_rec *r)
+ {
+-    int res, authenticated = 0;
+     const char *password;
++#endif
++    int res, authenticated = 0;
+     fcgi_request *fr;
+     const fcgi_dir_config * const dir_config =
+         (const fcgi_dir_config *)ap_get_module_config(r->per_dir_config, &fastcgi_module);
+@@ -2668,9 +2677,11 @@
+     if (dir_config->authenticator == NULL)
+         return DECLINED;
+ 
+-    /* Get the user password */
++#ifndef APACHE22
++		/* Get the user password */
+     if ((res = ap_get_basic_auth_pw(r, &password)) != OK)
+         return res;
++#endif /* APACHE22 */
+ 
+     res = create_fcgi_request(r, dir_config->authenticator, &fr);
+     if (res)
+@@ -2704,6 +2715,20 @@
+         goto AuthenticationFailed;
+     }
+ 
++#ifdef APACHE22
++    if (authenticated)
++        return AUTH_GRANTED;
++
++AuthenticationFailed:
++    /* @@@ Probably should support custom_responses */
++    ap_note_basic_auth_failure(r);
++    ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r,
++        "FastCGI: authentication failed for user \"%s\": %s",
++        r->user, r->uri);
++
++		return (res == OK) ? AUTH_DENIED : AUTH_GRANTED;
++
++#else /* !APACHE22 */
+     if (authenticated)
+         return OK;
+ 
+@@ -2722,6 +2747,7 @@
+ #endif
+ 
+         return (res == OK) ? HTTP_UNAUTHORIZED : res;
++#endif /* !APACHE22 */
+ }
+ 
+ static int check_user_authorization(request_rec *r)
+@@ -2913,16 +2939,31 @@
+ 
+ #ifdef APACHE2
+ 
++#ifdef APACHE22
++static const authn_provider authn_fastcgi_provider =
++{
++    &check_user_authentication,
++		NULL,
++};
++#endif /* APACHE22 */
++
++
+ static void register_hooks(apr_pool_t * p)
+ {
+     /* ap_hook_pre_config(x_pre_config, NULL, NULL, APR_HOOK_MIDDLE); */
+     ap_hook_post_config(init_module, NULL, NULL, APR_HOOK_MIDDLE);
+     ap_hook_child_init(fcgi_child_init, NULL, NULL, APR_HOOK_MIDDLE);
+     ap_hook_handler(content_handler, NULL, NULL, APR_HOOK_MIDDLE);
+-    ap_hook_check_user_id(check_user_authentication, NULL, NULL, APR_HOOK_MIDDLE);
+     ap_hook_access_checker(check_access, NULL, NULL, APR_HOOK_MIDDLE);
+     ap_hook_auth_checker(check_user_authorization, NULL, NULL, APR_HOOK_MIDDLE);
+     ap_hook_fixups(fixups, NULL, NULL, APR_HOOK_MIDDLE); 
++#ifdef APACHE22
++		ap_register_provider(p, AUTHN_PROVIDER_GROUP, "fastcgi", "0",
++			 &authn_fastcgi_provider);
++#else
++    ap_hook_check_user_id(check_user_authentication, NULL, NULL, APR_HOOK_MIDDLE);
++#endif
++
+ }
+ 
+ module AP_MODULE_DECLARE_DATA fastcgi_module =
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/patches/apache2.2-compat.dpatch ceph-mod_fastcgi/debian/patches/apache2.2-compat.dpatch
--- mod_fastcgi-SNAP-0910052141/debian/patches/apache2.2-compat.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/patches/apache2.2-compat.dpatch	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,60 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## apache2.2-compat.dpatch by daniel.smertnig at gmail.com
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: compat for Apache 2.2
+## downlowded from: http://www.fastcgi.com/archives/fastcgi-developers/2005-December/004060.html
+##
+
+@DPATCH@
+diff -ruN mod_fastcgi-2.4.2/fcgi.h mod_fastcgi-2.4.2-ap22/fcgi.h
+--- mod_fastcgi-2.4.2/fcgi.h	2003-02-04 00:07:37.000000000 +0100
++++ mod_fastcgi-2.4.2-ap22/fcgi.h	2005-12-07 21:05:55.000000000 +0100
+@@ -73,6 +73,36 @@
+ #define ap_reset_timeout(a)
+ #define ap_unblock_alarms()
+ 
++/* starting with apache 2.2 the backward-compatibility defines for
++ * 1.3 APIs are not available anymore. Define them ourselves here.
++ */
++#ifndef ap_copy_table
++
++#define ap_copy_table apr_table_copy
++#define ap_cpystrn apr_cpystrn
++#define ap_destroy_pool apr_pool_destroy
++#define ap_isspace apr_isspace
++#define ap_make_array apr_array_make
++#define ap_make_table apr_table_make
++#define ap_null_cleanup apr_pool_cleanup_null 
++#define ap_palloc apr_palloc
++#define ap_pcalloc apr_pcalloc
++#define ap_psprintf apr_psprintf
++#define ap_pstrcat apr_pstrcat
++#define ap_pstrdup apr_pstrdup
++#define ap_pstrndup apr_pstrndup
++#define ap_push_array apr_array_push
++#define ap_register_cleanup apr_pool_cleanup_register
++#define ap_snprintf apr_snprintf
++#define ap_table_add apr_table_add
++#define ap_table_do apr_table_do
++#define ap_table_get apr_table_get
++#define ap_table_set apr_table_set
++#define ap_table_setn apr_table_setn
++#define ap_table_unset apr_table_unset
++
++#endif /* defined(ap_copy_table) */
++
+ #if (defined(HAVE_WRITEV) && !HAVE_WRITEV && !defined(NO_WRITEV)) || defined WIN32
+ #define NO_WRITEV
+ #endif
+diff -ruN mod_fastcgi-2.4.2/Makefile.AP2 mod_fastcgi-2.4.2-ap22/Makefile.AP2
+--- mod_fastcgi-2.4.2/Makefile.AP2	2002-07-29 03:36:34.000000000 +0200
++++ mod_fastcgi-2.4.2-ap22/Makefile.AP2	2005-12-07 20:27:50.000000000 +0100
+@@ -20,8 +20,6 @@
+ 
+ all: local-shared-build
+ 
+-install: install-modules
+-
+ clean:
+ 	-rm -f *.o *.lo *.slo *.la 
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/patches/apache2-segv-on-load.dpatch ceph-mod_fastcgi/debian/patches/apache2-segv-on-load.dpatch
--- mod_fastcgi-SNAP-0910052141/debian/patches/apache2-segv-on-load.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/patches/apache2-segv-on-load.dpatch	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## apache2-segv-on-load.dpatch by  <sugi@nemui.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: See the URL for details.
+## DP: http://www.fastcgi.com/archives/fastcgi-developers/2005-April/003673.html
+
+@DPATCH@
+diff -urNad libapache-mod-fastcgi~/mod_fastcgi.c libapache-mod-fastcgi/mod_fastcgi.c
+--- libapache-mod-fastcgi~/mod_fastcgi.c	2005-08-06 14:09:11.000000000 +0900
++++ libapache-mod-fastcgi/mod_fastcgi.c	2006-10-06 20:52:46.368480801 +0900
+@@ -2850,10 +2850,15 @@
+ 
+     get_request_identity(r, &uid, &gid);
+ 
+-    if (fcgi_util_fs_get_by_id(r->filename, uid, gid))
++    /* Only try this if r->filename is not NULL,
++     * otherwise Apache 2 crashes with SIGSEGV... */
++    if (r->filename)
+     {
+-        r->handler = FASTCGI_HANDLER_NAME;
+-        return OK;
++        if (fcgi_util_fs_get_by_id(r->filename, uid, gid))
++        {
++            r->handler = FASTCGI_HANDLER_NAME;
++            return OK;
++        }
+     }
+ 
+     return DECLINED;
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/patches/doc-misc-typo-fix.dpatch ceph-mod_fastcgi/debian/patches/doc-misc-typo-fix.dpatch
--- mod_fastcgi-SNAP-0910052141/debian/patches/doc-misc-typo-fix.dpatch	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/patches/doc-misc-typo-fix.dpatch	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## by Troestler Christophe <Christophe.Troestler@umh.ac.be>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix for document dead link 
+## DP: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=288270
+
+@DPATCH@
+--- libapache-mod-fastcgi-2.4.6.orig/docs/mod_fastcgi.html
++++ libapache-mod-fastcgi-2.4.6/docs/mod_fastcgi.html
+@@ -67,7 +67,7 @@
+         </P>
+         <P>
+             FastCGI applications under <CODE>mod_fastcgi</CODE> are defined as one of three types: static, dynamic, or
+-            external. They&#39;re configured using the <A HREF="#fastcgiserver">FastCgiServer</A>, <A HREF=
++            external. They&#39;re configured using the <A HREF="#FastCgiServer">FastCgiServer</A>, <A HREF=
+             "#FastCgiConfig">FastCgiConfig</A>, and <A HREF="#FastCgiExternalServer">FastCgiExternalServer</A> <A HREF=
+             "#directives">directives</A> respectively. Any URI that Apache identifies as a FastCGI application and
+             which hasn&#39;t been explicitly configured using a <A HREF="#fastcgiserver">FastCgiServer</A> or <A HREF=
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/README.source ceph-mod_fastcgi/debian/README.source
--- mod_fastcgi-SNAP-0910052141/debian/README.source	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/README.source	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,35 @@
+This package uses CDBS (and therefore simple-patchsys.mk) in order to 
+apply patches to the upstream source. Patches are stored in 
+debian/patches and their filenames usually end in .patch or .diff .
+For further details, see the man page for cdbs-edit-patch.
+
+All commands described below should be run from the top directory of the 
+package source tree, unless otherwise stated.
+
+ * To generate the fully patched source, in a form ready for
+   editing, that would be built to create Debian packages, run: 
+
+     make -f debian/rules apply-patches
+
+   Note: It has been proposed that, in future, this should happen 
+   automatically when you run dpkg-source -x on a CDBS 
+   simple-patchsys.mk source package.  However, this proposal has 
+   apparently not yet been implemented, so for now you have to do 
+   it yourself like this.
+
+ * To modify the source and save those modifications so that
+   they will be applied when building the package, pick a
+   suitably informative patch file name, for example
+   01_add_README.source_file.patch, and then run:
+
+     cdbs-edit-patch 01_add_README.source_file.patch
+
+   This will place you in a new shell in a temporary copy of the 
+   source tree.  Make your desired modifications to it, and then 
+   exit the shell to create the patch file containing them (this 
+   file will appear in debian/patches).
+
+ * To remove source modifications that are currently being
+   applied when building the package, run:
+
+     make -f debian/rules reverse-patches
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/rules ceph-mod_fastcgi/debian/rules
--- mod_fastcgi-SNAP-0910052141/debian/rules	2003-11-13 03:15:19.000000000 +0100
+++ ceph-mod_fastcgi/debian/rules	2014-07-08 14:28:33.184628874 +0200
@@ -1,50 +1,38 @@
 #!/usr/bin/make -f
-CFLAGS = -O2 -Wall
-ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
-CFLAGS += -g
-endif
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-INSTALL_PROGRAM += -s
-endif
-
-binary: binary-indep binary-arch
-
-binary-indep:
-
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	#dh_installchangelogs CHANGES
-	dh_installdocs docs/mod_fastcgi.html CHANGES
-	dh_installdeb
-	dh_fixperms
-	dh_shlibdeps
-	dh_compress
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-	dh_strip
-endif
-	dh_md5sums
-	dh_gencontrol
-	dh_builddeb
-
-build: build-stamp
-build-stamp:
-	dh_testdir
-	CFLAGS="$(CFLAGS)" /usr/bin/apxs -o mod_fastcgi.so -c *.c
-	touch build-stamp
-	
-clean:
-	dh_testdir
-	rm -f build-stamp
-	-rm -f *.o mod_fastcgi.so			
-	dh_clean build-stamp
-
-install:
-	dh_testdir
-	dh_installdirs
-	mkdir -p debian/tmp/usr/lib/apache/1.3
-	cp mod_fastcgi.so debian/tmp/usr/lib/apache/1.3/
-	chmod 644 debian/tmp/usr/lib/apache/1.3/mod_fastcgi.so
-	cp debian/500mod_fastcgi.info debian/tmp/usr/lib/apache/1.3/		
-	
-.PHONY: binary binary-arch binary-indep clean build install 
+
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/class/langcore.mk
+include /usr/share/cdbs/1/class/makefile-vars.mk
+include /usr/share/cdbs/1/rules/dpatch.mk
+
+APACHE2_VERSION=`dpkg -s apache2-prefork-dev apache2-threaded-dev 2>/dev/null |grep Version: | awk '{print $$2}'`
+
+DEB_BUILDDIR = $(CURDIR)/build-tmp
+DEB_BUILDDIR_libapache2-mod-fastcgi = $(DEB_BUILDDIR)/20
+DEB_DESTDIR_libapache2-mod-fastcgi = $(CURDIR)/debian/libapache2-mod-fastcgi
+DEB_FIXPERMS_EXCLUDE = var/lib/apache2/fastcgi var/lib/apache/fastcgi
+
+AP2_MAKE_DEFS = top_dir=/usr/share/apache2 \
+	APXS=apxs2 APACHECTL=apachectl2 \
+	LIBTOOL="libtool --tag=CC" SH_LIBTOOL="libtool --tag=CC" \
+	INCLUDES="-I/usr/include/apache2 `pkg-config --cflags apr-1`"
+
+configure/libapache2-mod-fastcgi::
+	cp -a *.c *.h *.mk .deps $(DEB_BUILDDIR_$(cdbs_curpkg))
+	cp -a Makefile.AP2 $(DEB_BUILDDIR_$(cdbs_curpkg))
+
+build/libapache2-mod-fastcgi::
+	$(DEB_MAKE_INVOKE) -C $(DEB_BUILDDIR_$(cdbs_curpkg)) $(AP2_MAKE_DEFS) -f Makefile.AP2
+
+install/libapache2-mod-fastcgi::
+	mkdir -p $(DEB_DESTDIR_$(cdbs_curpkg))/usr/lib/apache2/modules
+	install -m 644 $(DEB_BUILDDIR_$(cdbs_curpkg))/.libs/mod_fastcgi.so \
+	  $(DEB_DESTDIR_$(cdbs_curpkg))/usr/lib/apache2/modules
+	mkdir -p $(DEB_DESTDIR_$(cdbs_curpkg))/etc/apache2/mods-available
+	install -m 644 debian/fastcgi.load \
+	  $(DEB_DESTDIR_$(cdbs_curpkg))/etc/apache2/mods-available
+	install -m 644 debian/fastcgi.conf2 \
+	  $(DEB_DESTDIR_$(cdbs_curpkg))/etc/apache2/mods-available/fastcgi.conf
+	mkdir -p $(DEB_DESTDIR_$(cdbs_curpkg))/var/lib/apache2/fastcgi
+	chown www-data:www-data $(DEB_DESTDIR_$(cdbs_curpkg))/var/lib/apache2/fastcgi
+	chmod 755 $(DEB_DESTDIR_$(cdbs_curpkg))/var/lib/apache2/fastcgi
diff -x .git -urN mod_fastcgi-SNAP-0910052141/debian/watch ceph-mod_fastcgi/debian/watch
--- mod_fastcgi-SNAP-0910052141/debian/watch	1970-01-01 01:00:00.000000000 +0100
+++ ceph-mod_fastcgi/debian/watch	2014-07-08 14:28:33.184628874 +0200
@@ -0,0 +1,5 @@
+version=2
+
+http://www.fastcgi.com/dist/ \
+	mod_fastcgi-([\d.]+)\.tar\.gz \
+	debian uupdate