[Pkg-apache-commits] [SCM] Debian packaging for apache2 (Apache HTTPD 2.x) branch, next, updated. 72462797178ce45916320837815815a3771d64a3
Stefan Fritsch
sf at sfritsch.de
Mon Feb 6 21:59:16 UTC 2012
The following commit has been merged in the next branch:
commit 72462797178ce45916320837815815a3771d64a3
Author: Stefan Fritsch <sf at sfritsch.de>
Date: Mon Feb 6 22:58:42 2012 +0100
Remove some patches that are included upstream
diff --git a/debian/patches/045_suexec_log_cloexec b/debian/patches/045_suexec_log_cloexec
deleted file mode 100755
index 962628a..0000000
--- a/debian/patches/045_suexec_log_cloexec
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## suexec_log_cloexec.dpatch
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Patch to allow suexec to log after a cgi error (#312385)
-## DP: http://issues.apache.org/bugzilla/show_bug.cgi?id=10744
-
- at DPATCH@
-
---- a/support/suexec.c
-+++ b/support/suexec.c
-@@ -46,6 +46,7 @@
- #include <stdio.h>
- #include <stdarg.h>
- #include <stdlib.h>
-+#include <fcntl.h>
-
- #ifdef HAVE_PWD_H
- #include <pwd.h>
-@@ -598,17 +599,14 @@
- #endif /* AP_SUEXEC_UMASK */
-
- /*
-- * Be sure to close the log file so the CGI can't
-- * mess with it. If the exec fails, it will be reopened
-- * automatically when log_err is called. Note that the log
-- * might not actually be open if AP_LOG_EXEC isn't defined.
-- * However, the "log" cell isn't ifdef'd so let's be defensive
-- * and assume someone might have done something with it
-- * outside an ifdef'd AP_LOG_EXEC block.
-- */
-- if (log != NULL) {
-- fclose(log);
-- log = NULL;
-+ * ask fcntl(2) to set the FD_CLOEXEC flag on the log file,
-+ * so it'll be automagically closed if the exec() call succeeds.
-+ */
-+ fflush(log);
-+ setbuf(log,NULL);
-+ if(fcntl(fileno(log),F_SETFD,FD_CLOEXEC)==-1) {
-+ log_err("error: can't set close-on-exec flag");
-+ exit(122);
- }
-
- /*
diff --git a/debian/patches/057_disablemods b/debian/patches/057_disablemods
deleted file mode 100755
index 8935b4d..0000000
--- a/debian/patches/057_disablemods
+++ /dev/null
@@ -1,60 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## Stolen from the fedora package
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Support "--enable-modules=none" to build an httpd binary with
-## DP: no optional modules enabled.
-
- at DPATCH@
---- a/acinclude.m4
-+++ b/acinclude.m4
-@@ -290,14 +290,19 @@
-
- AC_ARG_ENABLE(modules,
- APACHE_HELP_STRING(--enable-modules=MODULE-LIST,Space-separated list of modules to enable | "all" | "most"),[
-- for i in $enableval; do
-- if test "$i" = "all" -o "$i" = "most"; then
-- module_selection=$i
-- else
-- i=`echo $i | sed 's/-/_/g'`
-- eval "enable_$i=yes"
-- fi
-- done
-+ if test "$enableval" = "none"; then
-+ module_default=no
-+ module_selection=none
-+ else
-+ for i in $enableval; do
-+ if test "$i" = "all" -o "$i" = "most"; then
-+ module_selection=$i
-+ else
-+ i=`echo $i | sed 's/-/_/g'`
-+ eval "enable_$i=yes"
-+ fi
-+ done
-+ fi
- ])
-
- AC_ARG_ENABLE(mods-shared,
---- a/configure
-+++ b/configure
-@@ -7385,6 +7385,10 @@
- # Check whether --enable-modules was given.
- if test "${enable_modules+set}" = set; then :
- enableval=$enable_modules;
-+ if test "$enableval" = "none"; then
-+ module_default=no
-+ module_selection=none
-+ else
- for i in $enableval; do
- if test "$i" = "all" -o "$i" = "most"; then
- module_selection=$i
-@@ -7393,7 +7397,7 @@
- eval "enable_$i=yes"
- fi
- done
--
-+ fi
- fi
-
-
diff --git a/debian/patches/067_fix_segfault_in_ab b/debian/patches/067_fix_segfault_in_ab
deleted file mode 100755
index 7604e0d..0000000
--- a/debian/patches/067_fix_segfault_in_ab
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 067_fix_segfault_in_ab.dpatch by Ryan Niebur <ryanryan52 at gmail.com>
-##
-## DP: Do not free what SSL_get_peer_cert_chain returns. It returns a
-## pointer to memory that is freed later on with the
-## session. (Bug#495982)
-## Forwarded: https://issues.apache.org/bugzilla/show_bug.cgi?id=46393
-
- at DPATCH@
---- a/support/ab.c
-+++ b/support/ab.c
-@@ -548,7 +548,6 @@
- for (i=1; i<count; i++) {
- cert = (X509 *)SK_VALUE(sk, i);
- ssl_print_cert_info(bio_out, cert);
-- X509_free(cert);
- }
- }
- cert = SSL_get_peer_certificate(c->ssl);
diff --git a/debian/patches/071_fix_cacheenable b/debian/patches/071_fix_cacheenable
deleted file mode 100644
index 1cb933e..0000000
--- a/debian/patches/071_fix_cacheenable
+++ /dev/null
@@ -1,116 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Bug #442266
-## DP: r821333,r821538,r821539 from upstream svn
-
- at DPATCH@
---- a/modules/cache/cache_util.c
-+++ b/modules/cache/cache_util.c
-@@ -29,41 +29,78 @@
- /* Determine if "url" matches the hostname, scheme and port and path
- * in "filter". All but the path comparisons are case-insensitive.
- */
--static int uri_meets_conditions(apr_uri_t filter, int pathlen, apr_uri_t url)
--{
-- /* Compare the hostnames */
-- if(filter.hostname) {
-- if (!url.hostname) {
-- return 0;
-- }
-- else if (strcasecmp(filter.hostname, url.hostname)) {
-- return 0;
-- }
-- }
-+static int uri_meets_conditions(const apr_uri_t filter, const int pathlen,
-+ const apr_uri_t url) {
-
-- /* Compare the schemes */
-- if(filter.scheme) {
-- if (!url.scheme) {
-- return 0;
-- }
-- else if (strcasecmp(filter.scheme, url.scheme)) {
-+ /* Scheme, hostname port and local part. The filter URI and the
-+ * URI we test may have the following shapes:
-+ * /<path>
-+ * <scheme>[:://<hostname>[:<port>][/<path>]]
-+ * That is, if there is no scheme then there must be only the path,
-+ * and we check only the path; if there is a scheme, we check the
-+ * scheme for equality, and then if present we match the hostname,
-+ * and then if present match the port, and finally the path if any.
-+ *
-+ * Note that this means that "/<path>" only matches local paths,
-+ * and to match proxied paths one *must* specify the scheme.
-+ */
-+
-+ /* Is the filter is just for a local path or a proxy URI? */
-+ if (!filter.scheme) {
-+ if (url.scheme || url.hostname) {
- return 0;
- }
- }
--
-- /* Compare the ports */
-- if(filter.port_str) {
-- if (url.port_str && filter.port != url.port) {
-+ else {
-+ /* The URI scheme must be present and identical except for case. */
-+ if (!url.scheme || strcasecmp(filter.scheme, url.scheme)) {
- return 0;
- }
-- /* NOTE: ap_port_of_scheme will return 0 if given NULL input */
-- else if (filter.port != apr_uri_port_of_scheme(url.scheme)) {
-- return 0;
-+
-+ /* If the filter hostname is null or empty it matches any hostname,
-+ * if it begins with a "*" it matches the _end_ of the URI hostname
-+ * excluding the "*", if it begins with a "." it matches the _end_
-+ * of the URI * hostname including the ".", otherwise it must match
-+ * the URI hostname exactly. */
-+
-+ if (filter.hostname && filter.hostname[0]) {
-+ if (filter.hostname[0] == '.') {
-+ const size_t fhostlen = strlen(filter.hostname);
-+ const size_t uhostlen = url.hostname ? strlen(url.hostname) : 0;
-+
-+ if (fhostlen > uhostlen || strcasecmp(filter.hostname,
-+ url.hostname + uhostlen - fhostlen)) {
-+ return 0;
-+ }
-+ }
-+ else if (filter.hostname[0] == '*') {
-+ const size_t fhostlen = strlen(filter.hostname + 1);
-+ const size_t uhostlen = url.hostname ? strlen(url.hostname) : 0;
-+
-+ if (fhostlen > uhostlen || strcasecmp(filter.hostname + 1,
-+ url.hostname + uhostlen - fhostlen)) {
-+ return 0;
-+ }
-+ }
-+ else if (!url.hostname || strcasecmp(filter.hostname, url.hostname)) {
-+ return 0;
-+ }
- }
-- }
-- else if(url.port_str && filter.scheme) {
-- if (apr_uri_port_of_scheme(filter.scheme) == url.port) {
-- return 0;
-+
-+ /* If the filter port is empty it matches any URL port.
-+ * If the filter or URL port are missing, or the URL port is
-+ * empty, they default to the port for their scheme. */
-+
-+ if (!(filter.port_str && !filter.port_str[0])) {
-+ /* NOTE: ap_port_of_scheme will return 0 if given NULL input */
-+ const unsigned fport = filter.port_str ? filter.port
-+ : apr_uri_port_of_scheme(filter.scheme);
-+ const unsigned uport = (url.port_str && url.port_str[0])
-+ ? url.port : apr_uri_port_of_scheme(url.scheme);
-+
-+ if (fport != uport) {
-+ return 0;
-+ }
- }
- }
-
diff --git a/debian/patches/073_mod_dav_trunk_fixes b/debian/patches/073_mod_dav_trunk_fixes
deleted file mode 100644
index 667faf2..0000000
--- a/debian/patches/073_mod_dav_trunk_fixes
+++ /dev/null
@@ -1,517 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Various bug fixes for mod_dav/mod_dav_fs
-## DP: upstream svn revs 834018:835092 and 928403 in modules/dav
-## DP:
-## DP: *) mod_dav: Include uri when logging a PUT error due to connection abort.
-## DP: PR 38149. [Stefan Fritsch]
-## DP:
-## DP: *) mod_dav: Return 409 instead of 500 for a LOCK request if the parent
-## DP: resource does not exist or is not a collection. PR 43465. [Stefan Fritsch]
-## DP:
-## DP: *) mod_dav_fs: Return 409 instead of 500 for Litmus test case copy_nodestcoll
-## DP: (a COPY request where the parent of the destination resource does not
-## DP: exist). PR 39299. [Stefan Fritsch]
-## DP:
-## DP: *) mod_dav_fs: Don't delete the whole file if a PUT with content-range failed.
-## DP: PR 42896. [Stefan Fritsch]
-## DP:
-## DP: *) mod_dav_fs: Make PUT create files atomically and no longer destroy the
-## DP: old file if the transfer aborted. PR 39815. [Paul Querna, Stefan Fritsch]
-## DP:
-## DP: *) mod_dav_fs: Remove inode keyed locking as this conflicts with atomically
-## DP: creating files. On systems with inode numbers, this is a format change of
-## DP: the DavLockDB. The old DavLockDB must be deleted on upgrade.
-## DP: [Stefan Fritsch]
- at DPATCH@
---- a/modules/dav/fs/lock.c
-+++ b/modules/dav/fs/lock.c
-@@ -48,9 +48,8 @@
- **
- ** KEY
- **
--** The database is keyed by a key_type unsigned char (DAV_TYPE_INODE or
--** DAV_TYPE_FNAME) followed by inode and device number if possible,
--** otherwise full path (in the case of Win32 or lock-null resources).
-+** The database is keyed by a key_type unsigned char (DAV_TYPE_FNAME)
-+** followed by the full path. The key_type DAV_TYPE_INODE is not used anymore.
- **
- ** VALUE
- **
-@@ -82,7 +81,10 @@
- #define DAV_LOCK_DIRECT 1
- #define DAV_LOCK_INDIRECT 2
-
--#define DAV_TYPE_INODE 10
-+/*
-+ * not used anymore
-+ * #define DAV_TYPE_INODE 10
-+ */
- #define DAV_TYPE_FNAME 11
-
-
-@@ -372,12 +374,13 @@
- }
-
- /*
--** dav_fs_build_fname_key
--**
--** Given a pathname, build a DAV_TYPE_FNAME lock database key.
-+** dav_fs_build_key: Given a resource, return a apr_datum_t key
-+** to look up lock information for this file.
- */
--static apr_datum_t dav_fs_build_fname_key(apr_pool_t *p, const char *pathname)
-+static apr_datum_t dav_fs_build_key(apr_pool_t *p,
-+ const dav_resource *resource)
- {
-+ const char *pathname = dav_fs_pathname(resource);
- apr_datum_t key;
-
- /* ### does this allocation have a proper lifetime? need to check */
-@@ -394,46 +397,6 @@
- }
-
- /*
--** dav_fs_build_key: Given a resource, return a apr_datum_t key
--** to look up lock information for this file.
--**
--** (inode/dev not supported or file is lock-null):
--** apr_datum_t->dvalue = full path
--**
--** (inode/dev supported and file exists ):
--** apr_datum_t->dvalue = inode, dev
--*/
--static apr_datum_t dav_fs_build_key(apr_pool_t *p,
-- const dav_resource *resource)
--{
-- const char *file = dav_fs_pathname(resource);
-- apr_datum_t key;
-- apr_finfo_t finfo;
-- apr_status_t rv;
--
-- /* ### use lstat() ?? */
-- /*
-- * XXX: What for platforms with no IDENT (dev/inode)?
-- */
-- rv = apr_stat(&finfo, file, APR_FINFO_IDENT, p);
-- if ((rv == APR_SUCCESS || rv == APR_INCOMPLETE)
-- && ((finfo.valid & APR_FINFO_IDENT) == APR_FINFO_IDENT))
-- {
-- /* ### can we use a buffer for this? */
-- key.dsize = 1 + sizeof(finfo.inode) + sizeof(finfo.device);
-- key.dptr = apr_palloc(p, key.dsize);
-- *key.dptr = DAV_TYPE_INODE;
-- memcpy(key.dptr + 1, &finfo.inode, sizeof(finfo.inode));
-- memcpy(key.dptr + 1 + sizeof(finfo.inode), &finfo.device,
-- sizeof(finfo.device));
--
-- return key;
-- }
--
-- return dav_fs_build_fname_key(p, file);
--}
--
--/*
- ** dav_fs_lock_expired: return 1 (true) if the given timeout is in the past
- ** or present (the lock has expired), or 0 (false) if in the future
- ** (the lock has not yet expired).
-@@ -989,13 +952,8 @@
-
- /*
- ** dav_fs_remove_locknull_state: Given a request, check to see if r->filename
--** is/was a lock-null resource. If so, return it to an existant state.
--**
--** ### this function is broken... it doesn't check!
--**
--** In this implementation, this involves two things:
--** (a) remove it from the list in the appropriate .DAV/locknull file
--** (b) on *nix, convert the key from a filename to an inode.
-+** is/was a lock-null resource. If so, return it to an existant state, i.e.
-+** remove it from the list in the appropriate .DAV/locknull file.
- */
- static dav_error * dav_fs_remove_locknull_state(
- dav_lockdb *lockdb,
-@@ -1011,35 +969,6 @@
- return err;
- }
-
-- {
-- dav_lock_discovery *ld;
-- dav_lock_indirect *id;
-- apr_datum_t key;
--
-- /*
-- ** Fetch the lock(s) that made the resource lock-null. Remove
-- ** them under the filename key. Obtain the new inode key, and
-- ** save the same lock information under it.
-- */
-- key = dav_fs_build_fname_key(p, pathname);
-- if ((err = dav_fs_load_lock_record(lockdb, key, DAV_CREATE_LIST,
-- &ld, &id)) != NULL) {
-- /* ### insert a higher-level error description */
-- return err;
-- }
--
-- if ((err = dav_fs_save_lock_record(lockdb, key, NULL, NULL)) != NULL) {
-- /* ### insert a higher-level error description */
-- return err;
-- }
--
-- key = dav_fs_build_key(p, resource);
-- if ((err = dav_fs_save_lock_record(lockdb, key, ld, id)) != NULL) {
-- /* ### insert a higher-level error description */
-- return err;
-- }
-- }
--
- return NULL;
- }
-
---- a/modules/dav/fs/repos.c
-+++ b/modules/dav/fs/repos.c
-@@ -27,6 +27,10 @@
- #include <stdio.h> /* for sprintf() */
- #endif
-
-+#if APR_HAVE_UNISTD_H
-+#include <unistd.h> /* for getpid() */
-+#endif
-+
- #include "httpd.h"
- #include "http_log.h"
- #include "http_protocol.h" /* for ap_set_* (in dav_fs_set_headers) */
-@@ -139,6 +143,11 @@
- */
- #define DAV_PROPID_FS_executable 1
-
-+/*
-+ * prefix for temporary files
-+ */
-+#define DAV_FS_TMP_PREFIX ".davfs.tmp"
-+
- static const dav_liveprop_spec dav_fs_props[] =
- {
- /* standard DAV properties */
-@@ -191,11 +200,14 @@
- apr_pool_t *p;
- apr_file_t *f;
- const char *pathname; /* we may need to remove it at close time */
-+ char *temppath;
-+ int unlink_on_error;
- };
-
- /* returns an appropriate HTTP status code given an APR status code for a
- * failed I/O operation. ### use something besides 500? */
- #define MAP_IO2HTTP(e) (APR_STATUS_IS_ENOSPC(e) ? HTTP_INSUFFICIENT_STORAGE : \
-+ APR_STATUS_IS_ENOENT(e) ? HTTP_CONFLICT : \
- HTTP_INTERNAL_SERVER_ERROR)
-
- /* forward declaration for internal treewalkers */
-@@ -414,11 +426,24 @@
- apr_file_close(inf);
- apr_file_close(outf);
-
-- if (is_move && apr_file_remove(src, p) != APR_SUCCESS) {
-+ if (is_move && (status = apr_file_remove(src, p)) != APR_SUCCESS) {
- dav_error *err;
- int save_errno = errno; /* save the errno that got us here */
-
-- if (apr_file_remove(dst, p) != APR_SUCCESS) {
-+ if (APR_STATUS_IS_ENOENT(status)) {
-+ /*
-+ * Something is wrong here but the result is what we wanted.
-+ * We definitely should not remove the destination file.
-+ */
-+ err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
-+ apr_psprintf(p, "Could not remove source "
-+ "file %s after move to %s. The "
-+ "server may be in an "
-+ "inconsistent state.", src, dst));
-+ err->save_errno = save_errno;
-+ return err;
-+ }
-+ else if (apr_file_remove(dst, p) != APR_SUCCESS) {
- /* ### ACK. this creates an inconsistency. do more!? */
-
- /* ### use something besides 500? */
-@@ -500,9 +525,13 @@
- dst = apr_pstrcat(p, dst, "/", dst_file, NULL);
-
- /* copy/move the file now */
-- if (is_move && src_finfo.device == dst_state_finfo.device) {
-- /* simple rename is possible since it is on the same device */
-- if (apr_file_rename(src, dst, p) != APR_SUCCESS) {
-+ if (is_move) {
-+ /* try simple rename first */
-+ rv = apr_file_rename(src, dst, p);
-+ if (APR_STATUS_IS_EXDEV(rv)) {
-+ return dav_fs_copymove_file(is_move, p, src, dst, NULL, NULL, pbuf);
-+ }
-+ if (rv != APR_SUCCESS) {
- /* ### use something besides 500? */
- return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0,
- "Could not move state file.");
-@@ -841,6 +870,34 @@
- && ctx2->pathname[len1] == '/');
- }
-
-+static apr_status_t tmpfile_cleanup(void *data) {
-+ dav_stream *ds = data;
-+ if (ds->temppath) {
-+ apr_file_remove(ds->temppath, ds->p);
-+ }
-+ return APR_SUCCESS;
-+}
-+
-+/* custom mktemp that creates the file with APR_OS_DEFAULT permissions */
-+static apr_status_t dav_fs_mktemp(apr_file_t **fp, char *templ, apr_pool_t *p)
-+{
-+ apr_status_t rv;
-+ int num = ((getpid() << 7) + (int)templ % (1 << 16) ) % ( 1 << 23 ) ;
-+ char *numstr = templ + strlen(templ) - 6;
-+
-+ ap_assert(numstr >= templ);
-+
-+ do {
-+ num = (num + 1) % ( 1 << 23 );
-+ snprintf(numstr, 7, "%06x", num);
-+ rv = apr_file_open(fp, templ,
-+ APR_WRITE | APR_CREATE | APR_BINARY | APR_EXCL,
-+ APR_OS_DEFAULT, p);
-+ } while (APR_STATUS_IS_EEXIST(rv));
-+
-+ return rv;
-+}
-+
- static dav_error * dav_fs_open_stream(const dav_resource *resource,
- dav_stream_mode mode,
- dav_stream **stream)
-@@ -865,7 +922,32 @@
-
- ds->p = p;
- ds->pathname = resource->info->pathname;
-- rv = apr_file_open(&ds->f, ds->pathname, flags, APR_OS_DEFAULT, ds->p);
-+ ds->temppath = NULL;
-+ ds->unlink_on_error = 0;
-+
-+ if (mode == DAV_MODE_WRITE_TRUNC) {
-+ ds->temppath = apr_pstrcat(p, ap_make_dirstr_parent(p, ds->pathname),
-+ DAV_FS_TMP_PREFIX "XXXXXX", NULL);
-+ rv = dav_fs_mktemp(&ds->f, ds->temppath, ds->p);
-+ apr_pool_cleanup_register(p, ds, tmpfile_cleanup,
-+ apr_pool_cleanup_null);
-+ }
-+ else if (mode == DAV_MODE_WRITE_SEEKABLE) {
-+ rv = apr_file_open(&ds->f, ds->pathname, flags | APR_FOPEN_EXCL,
-+ APR_OS_DEFAULT, ds->p);
-+ if (rv == APR_SUCCESS) {
-+ /* we have created a new file */
-+ ds->unlink_on_error = 1;
-+ }
-+ else if (APR_STATUS_IS_EEXIST(rv)) {
-+ rv = apr_file_open(&ds->f, ds->pathname, flags, APR_OS_DEFAULT,
-+ ds->p);
-+ }
-+ }
-+ else {
-+ rv = apr_file_open(&ds->f, ds->pathname, flags, APR_OS_DEFAULT, ds->p);
-+ }
-+
- if (rv != APR_SUCCESS) {
- return dav_new_error(p, MAP_IO2HTTP(rv), 0,
- "An error occurred while opening a resource.");
-@@ -879,17 +961,33 @@
-
- static dav_error * dav_fs_close_stream(dav_stream *stream, int commit)
- {
-+ apr_status_t rv;
-+
- apr_file_close(stream->f);
-
- if (!commit) {
-- if (apr_file_remove(stream->pathname, stream->p) != APR_SUCCESS) {
-- /* ### use a better description? */
-- return dav_new_error(stream->p, HTTP_INTERNAL_SERVER_ERROR, 0,
-- "There was a problem removing (rolling "
-- "back) the resource "
-- "when it was being closed.");
-+ if (stream->temppath) {
-+ apr_pool_cleanup_run(stream->p, stream, tmpfile_cleanup);
-+ }
-+ else if (stream->unlink_on_error) {
-+ if (apr_file_remove(stream->pathname, stream->p) != APR_SUCCESS) {
-+ /* ### use a better description? */
-+ return dav_new_error(stream->p, HTTP_INTERNAL_SERVER_ERROR, 0,
-+ "There was a problem removing (rolling "
-+ "back) the resource "
-+ "when it was being closed.");
-+ }
- }
- }
-+ else if (stream->temppath) {
-+ rv = apr_file_rename(stream->temppath, stream->pathname, stream->p);
-+ if (rv) {
-+ return dav_new_error(stream->p, HTTP_INTERNAL_SERVER_ERROR, rv,
-+ "There was a problem writing the file "
-+ "atomically after writes.");
-+ }
-+ apr_pool_cleanup_kill(stream->p, stream, tmpfile_cleanup);
-+ }
-
- return NULL;
- }
-@@ -1201,7 +1299,7 @@
- dav_resource_private *srcinfo = src->info;
- dav_resource_private *dstinfo = dst->info;
- dav_error *err;
-- int can_rename = 0;
-+ apr_status_t rv;
-
- #if DAV_DEBUG
- if (src->hooks != dst->hooks) {
-@@ -1215,39 +1313,12 @@
- }
- #endif
-
-- /* determine whether a simple rename will work.
-- * Assume source exists, else we wouldn't get called.
-- */
-- if (dstinfo->finfo.filetype != 0) {
-- if (dstinfo->finfo.device == srcinfo->finfo.device) {
-- /* target exists and is on the same device. */
-- can_rename = 1;
-- }
-- }
-- else {
-- const char *dirpath;
-- apr_finfo_t finfo;
-- apr_status_t rv;
-
-- /* destination does not exist, but the parent directory should,
-- * so try it
-- */
-- dirpath = ap_make_dirstr_parent(dstinfo->pool, dstinfo->pathname);
-- /*
-- * XXX: If missing dev ... then what test?
-- * Really need a try and failover for those platforms.
-- *
-- */
-- rv = apr_stat(&finfo, dirpath, APR_FINFO_DEV, dstinfo->pool);
-- if ((rv == APR_SUCCESS || rv == APR_INCOMPLETE)
-- && (finfo.valid & srcinfo->finfo.valid & APR_FINFO_DEV)
-- && (finfo.device == srcinfo->finfo.device)) {
-- can_rename = 1;
-- }
-- }
-+ /* try rename first */
-+ rv = apr_file_rename(srcinfo->pathname, dstinfo->pathname, srcinfo->pool);
-
- /* if we can't simply rename, then do it the hard way... */
-- if (!can_rename) {
-+ if (APR_STATUS_IS_EXDEV(rv)) {
- if ((err = dav_fs_copymove_resource(1, src, dst, DAV_INFINITY,
- response)) == NULL) {
- /* update resource states */
-@@ -1260,20 +1331,16 @@
- return err;
- }
-
-- /* a rename should work. do it, and move properties as well */
--
- /* no multistatus response */
- *response = NULL;
-
-- /* ### APR has no rename? */
-- if (apr_file_rename(srcinfo->pathname, dstinfo->pathname,
-- srcinfo->pool) != APR_SUCCESS) {
-+ if (rv != APR_SUCCESS) {
- /* ### should have a better error than this. */
- return dav_new_error(srcinfo->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
- "Could not rename resource.");
- }
-
-- /* update resource states */
-+ /* Rename did work. Update resource states and move properties as well */
- dst->exists = 1;
- dst->collection = src->collection;
- src->exists = 0;
-@@ -1475,14 +1542,18 @@
- /* ### need to authorize each file */
- /* ### example: .htaccess is normally configured to fail auth */
-
-- /* stuff in the state directory is never authorized! */
-- if (!strcmp(dirent.name, DAV_FS_STATE_DIR)) {
-+ /* stuff in the state directory and temp files are never authorized! */
-+ if (!strcmp(dirent.name, DAV_FS_STATE_DIR) ||
-+ !strncmp(dirent.name, DAV_FS_TMP_PREFIX,
-+ strlen(DAV_FS_TMP_PREFIX))) {
- continue;
- }
- }
-- /* skip the state dir unless a HIDDEN is performed */
-+ /* skip the state dir and temp files unless a HIDDEN is performed */
- if (!(params->walk_type & DAV_WALKTYPE_HIDDEN)
-- && !strcmp(dirent.name, DAV_FS_STATE_DIR)) {
-+ && (!strcmp(dirent.name, DAV_FS_STATE_DIR) ||
-+ !strncmp(dirent.name, DAV_FS_TMP_PREFIX,
-+ strlen(DAV_FS_TMP_PREFIX)))) {
- continue;
- }
-
---- a/modules/dav/main/mod_dav.c
-+++ b/modules/dav/main/mod_dav.c
-@@ -998,7 +998,10 @@
-
- if (rc != APR_SUCCESS) {
- err = dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
-- "Could not get next bucket brigade");
-+ apr_psprintf(r->pool,
-+ "Could not get next bucket "
-+ "brigade (URI: %s)",
-+ ap_escape_html(r->pool, r->uri)));
- break;
- }
-
-@@ -1021,8 +1024,10 @@
- rc = apr_bucket_read(b, &data, &len, APR_BLOCK_READ);
- if (rc != APR_SUCCESS) {
- err = dav_new_error(r->pool, HTTP_BAD_REQUEST, 0,
-- "An error occurred while reading "
-- "the request body.");
-+ apr_psprintf(r->pool,
-+ "An error occurred while reading"
-+ " the request body (URI: %s)",
-+ ap_escape_html(r->pool, r->uri)));
- break;
- }
-
-@@ -2978,6 +2983,7 @@
- {
- dav_error *err;
- dav_resource *resource;
-+ dav_resource *parent;
- const dav_hooks_locks *locks_hooks;
- int result;
- int depth;
-@@ -3009,6 +3015,20 @@
- if (err != NULL)
- return dav_handle_err(r, err, NULL);
-
-+ /* Check if parent collection exists */
-+ if ((err = resource->hooks->get_parent_resource(resource, &parent)) != NULL) {
-+ /* ### add a higher-level description? */
-+ return dav_handle_err(r, err, NULL);
-+ }
-+ if (parent && (!parent->exists || parent->collection != 1)) {
-+ err = dav_new_error(r->pool, HTTP_CONFLICT, 0,
-+ apr_psprintf(r->pool,
-+ "The parent resource of %s does not "
-+ "exist or is not a collection.",
-+ ap_escape_html(r->pool, r->uri)));
-+ return dav_handle_err(r, err, NULL);
-+ }
-+
- /*
- * Open writable. Unless an error occurs, we'll be
- * writing into the database.
diff --git a/debian/patches/074_link_support_progs_with_lcrypt b/debian/patches/074_link_support_progs_with_lcrypt
deleted file mode 100755
index 3c08ffb..0000000
--- a/debian/patches/074_link_support_progs_with_lcrypt
+++ /dev/null
@@ -1,37 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 074_support_link_lcrypt.dpatch by Stefan Fritsch <sf at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Link support programs with -lcrypt where necessary. Required by
-## DP: binutils-gold (bug #553946)
-
- at DPATCH@
---- a/configure
-+++ b/configure
-@@ -14831,11 +14831,11 @@
-
- fi
-
--htpasswd_LTFLAGS=""
-+htpasswd_LTFLAGS="-lcrypt"
- htdigest_LTFLAGS=""
- rotatelogs_LTFLAGS=""
- logresolve_LTFLAGS=""
--htdbm_LTFLAGS=""
-+htdbm_LTFLAGS="-lcrypt"
- ab_LTFLAGS=""
- checkgid_LTFLAGS=""
- htcacheclean_LTFLAGS=""
---- a/support/config.m4
-+++ b/support/config.m4
-@@ -1,8 +1,8 @@
--htpasswd_LTFLAGS=""
-+htpasswd_LTFLAGS="-lcrypt"
- htdigest_LTFLAGS=""
- rotatelogs_LTFLAGS=""
- logresolve_LTFLAGS=""
--htdbm_LTFLAGS=""
-+htdbm_LTFLAGS="-lcrypt"
- ab_LTFLAGS=""
- checkgid_LTFLAGS=""
- htcacheclean_LTFLAGS=""
diff --git a/debian/patches/075_mod_rewrite_literal_ipv6_redirect b/debian/patches/075_mod_rewrite_literal_ipv6_redirect
deleted file mode 100755
index ad084ea..0000000
--- a/debian/patches/075_mod_rewrite_literal_ipv6_redirect
+++ /dev/null
@@ -1,51 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 075_mod_rewrite_literal_ipv6_redirect.dpatch by Stefan Fritsch <sf at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Add [] to literal ipv6 hosts in URLs (bug #557015)
-
- at DPATCH@
---- a/modules/mappers/mod_rewrite.c
-+++ b/modules/mappers/mod_rewrite.c
-@@ -840,6 +840,23 @@
- }
-
- /*
-+ * Get the current server name from the request for the purposes
-+ * of using in a URL. If the server name is an IPv6 literal
-+ * address, it will be returned in URL format (e.g., "[fe80::1]").
-+ */
-+static const char *get_server_name_for_url(request_rec *r)
-+{
-+ const char *plain_server_name = ap_get_server_name(r);
-+
-+#if APR_HAVE_IPV6
-+ if (ap_strchr_c(plain_server_name, ':')) { /* IPv6 literal? */
-+ return apr_psprintf(r->pool, "[%s]", plain_server_name);
-+ }
-+#endif
-+ return plain_server_name;
-+}
-+
-+/*
- * add 'http[s]://ourhost[:ourport]/' to URI
- * if URI is still not fully qualified
- */
-@@ -853,7 +870,7 @@
- char *thisport;
- int port;
-
-- thisserver = ap_get_server_name(r);
-+ thisserver = get_server_name_for_url(r);
- port = ap_get_server_port(r);
- thisport = ap_is_default_port(port, r)
- ? ""
-@@ -4290,7 +4307,7 @@
- */
-
- /* add the canonical URI of this URL */
-- thisserver = ap_get_server_name(r);
-+ thisserver = get_server_name_for_url(r);
- port = ap_get_server_port(r);
- if (ap_is_default_port(port, r)) {
- thisport = "";
diff --git a/debian/patches/077_CacheIgnoreURLSessionIdentifiers b/debian/patches/077_CacheIgnoreURLSessionIdentifiers
deleted file mode 100755
index 0886a44..0000000
--- a/debian/patches/077_CacheIgnoreURLSessionIdentifiers
+++ /dev/null
@@ -1,84 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Fix CacheIgnoreURLSessionIdentifiers
-## DP: r892289, r897705 from upstream svn. Debian bug #556383
-
- at DPATCH@
---- a/modules/cache/cache_storage.c
-+++ b/modules/cache/cache_storage.c
-@@ -505,28 +505,60 @@
- && (*(param + len + 1) == '=')
- && !strchr(param + len + 2, '/')) {
- path = apr_pstrndup(p, path, param - path);
-- break;
-+ continue;
- }
- /*
- * Check if the identifier is in the querystring and cut it out.
- */
-- if (querystring
-- && (param = strstr(querystring, *identifier))
-- && (*(param + len) == '=')
-- ) {
-- char *amp;
--
-- if (querystring != param) {
-- querystring = apr_pstrndup(p, querystring,
-- param - querystring);
-+ if (querystring) {
-+ /*
-+ * First check if the identifier is at the beginning of the
-+ * querystring and followed by a '='
-+ */
-+ if (!strncmp(querystring, *identifier, len)
-+ && (*(querystring + len) == '=')) {
-+ param = querystring;
- }
- else {
-- querystring = "";
-+ char *complete;
-+
-+ /*
-+ * In order to avoid subkey matching (PR 48401) prepend
-+ * identifier with a '&' and append a '='
-+ */
-+ complete = apr_pstrcat(p, "&", *identifier, "=", NULL);
-+ param = strstr(querystring, complete);
-+ /* If we found something we are sitting on the '&' */
-+ if (param) {
-+ param++;
-+ }
- }
-- if ((amp = strchr(param + len + 1, '&'))) {
-- querystring = apr_pstrcat(p, querystring, amp + 1, NULL);
-+ if (param) {
-+ char *amp;
-+
-+ if (querystring != param) {
-+ querystring = apr_pstrndup(p, querystring,
-+ param - querystring);
-+ }
-+ else {
-+ querystring = "";
-+ }
-+
-+ if ((amp = strchr(param + len + 1, '&'))) {
-+ querystring = apr_pstrcat(p, querystring, amp + 1, NULL);
-+ }
-+ else {
-+ /*
-+ * If querystring is not "", then we have the case
-+ * that the identifier parameter we removed was the
-+ * last one in the original querystring. Hence we have
-+ * a trailing '&' which needs to be removed.
-+ */
-+ if (*querystring) {
-+ querystring[strlen(querystring) - 1] = '\0';
-+ }
-+ }
- }
-- break;
- }
- }
- }
diff --git a/debian/patches/079_polish_translation b/debian/patches/079_polish_translation
deleted file mode 100755
index c6daa96..0000000
--- a/debian/patches/079_polish_translation
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 079_polish_translation.dpatch by Stefan Fritsch <sf at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: #570228
-
- at DPATCH@
---- a/docs/error/HTTP_NOT_FOUND.html.var
-+++ b/docs/error/HTTP_NOT_FOUND.html.var
-@@ -289,7 +289,7 @@
- o problemie.
-
- <!--#else -->
-- Je¶li wpisa³e¶ URLa rêcznie, sprawd¼, czy nie siê nie pomyli³e¶.
-+ Je¶li wpisa³e¶ URLa rêcznie, sprawd¼, czy siê nie pomyli³e¶.
-
- <!--#endif -->
-
diff --git a/debian/patches/082_ab_num_requests b/debian/patches/082_ab_num_requests
deleted file mode 100755
index 325f7db..0000000
--- a/debian/patches/082_ab_num_requests
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 082_ab_num_requests.dpatch by Stefan Fritsch <sf at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Upstream r940526, Debian bug #541158
-
- at DPATCH@
---- a/support/ab.c
-+++ b/support/ab.c
-@@ -628,6 +628,10 @@
-
- static void write_request(struct connection * c)
- {
-+ if (started >= requests) {
-+ return;
-+ }
-+
- do {
- apr_time_t tnow;
- apr_size_t l = c->rwrite;
-@@ -690,6 +694,7 @@
- new_pollfd.client_data = c;
- apr_pollset_add(readbits, &new_pollfd);
- }
-+ started++;
- }
-
- /* --------------------------------------------------------- */
-@@ -1239,7 +1244,6 @@
-
- /* connected first time */
- c->state = STATE_CONNECTED;
-- started++;
- #ifdef USE_SSL
- if (c->ssl) {
- ssl_proceed_handshake(c);
-@@ -1768,7 +1772,6 @@
- }
- else {
- c->state = STATE_CONNECTED;
-- started++;
- #ifdef USE_SSL
- if (c->ssl)
- ssl_proceed_handshake(c);
diff --git a/debian/patches/series b/debian/patches/series
index 8c211a2..9b1ddea 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,20 +7,10 @@
#033_dbm_read_hash_or_btree
#034_apxs2_libtool_fixtastic
#038_no_LD_LIBRARY_PATH
-#045_suexec_log_cloexec
#047_fix_usage_message
#052_logresolve_linelength
-#057_disablemods
#058_suexec-CVE-2007-1742
-#067_fix_segfault_in_ab
-#071_fix_cacheenable
-#073_mod_dav_trunk_fixes
-#074_link_support_progs_with_lcrypt
-#075_mod_rewrite_literal_ipv6_redirect
#076_apxs2_a2enmod
-#077_CacheIgnoreURLSessionIdentifiers
-#079_polish_translation
-#082_ab_num_requests
#099_config_guess_sub_update
201_build_suexec-custom
# The patch below must not be applied by quilt at extraction time. It depends
--
Debian packaging for apache2 (Apache HTTPD 2.x)
More information about the Pkg-apache-commits
mailing list