From: Ruediger Pluem Date: Wed, 2 Jan 2008 09:41:46 +0000 (+0000) Subject: Merge r607437 from trunk: X-Git-Tag: 2.2.7~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45d8e798d6c2994f2539c4b94bc1e88ea7033664;p=thirdparty%2Fapache%2Fhttpd.git Merge r607437 from trunk: * Adjust etag generation to produce identical results on 32-bit and 64-bit platforms and avoid a regression with conditional PUT's on lock and etag. Add a warning to the documentation of FileETAG that changes of the ETAG format can cause conditionals to fail on mod_dav_fs provided backends. PR: 44152 Submitted by: Michael Clark eviewed by: rpluem, niq, wrowe git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@608059 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index bb60864dd8e..f6a6e43c94a 100644 --- a/CHANGES +++ b/CHANGES @@ -19,6 +19,11 @@ Changes with Apache 2.2.7 mod_imagemap: Fix a cross-site scripting issue. Reported by JPCERT. [Joe Orton] + *) mod_dav: Adjust etag generation to produce identical results on 32-bit + and 64-bit platforms and avoid a regression with conditional PUT's on lock + and etag. PR 44152. + [Michael Clark , Ruediger Pluem] + *) log.c: Ensure Win32 resurrects its lost robust logger processes. [William Rowe] diff --git a/STATUS b/STATUS index 86bbe3e7e90..1cdfae398ad 100644 --- a/STATUS +++ b/STATUS @@ -124,16 +124,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: Trunk version of patch works +1: rpluem, niq, wrowe - * mod_dav_fs: Adjust etag generation to produce identical results on 32-bit - and 64-bit platforms. Avoid a regression with conditional PUT's on lock - and etag (because we have a regression otherwise this is a showstopper). - PR 44152 - Trunk version of patch: - http://svn.apache.org/viewvc?rev=607437&view=rev - Backport version for 2.2.x of patch: - Trunk version of patch works - +1: rpluem, niq, wrowe - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index e157137f1ca..c2fb49d80cc 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -1163,6 +1163,14 @@ HTTP response header the setting for that subdirectory (which will be inherited by any sub-subdirectories that don't override it) will be equivalent to FileETag MTime Size.

+ Warning + Do not change the default for directories or locations that have WebDAV + enabled and use mod_dav_fs as a storage provider. + mod_dav_fs uses INode MTime Size + as a fixed format for ETag comparisons on conditional requests. + These conditional requests will break if the ETag format is + changed via FileETag. + diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index 8c28c0764af..a532e6e94fa 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -1777,13 +1777,15 @@ static const char *dav_fs_getetag(const dav_resource *resource) return apr_pstrdup(ctx->pool, ""); if (ctx->finfo.filetype != 0) { - return apr_psprintf(ctx->pool, "\"%lx-%lx-%lx\"", - (unsigned long) ctx->finfo.inode, - (unsigned long) ctx->finfo.size, - (unsigned long) ctx->finfo.mtime); + return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "-%" + APR_UINT64_T_HEX_FMT "-%" APR_UINT64_T_HEX_FMT "\"", + (apr_uint64_t) ctx->finfo.inode, + (apr_uint64_t) ctx->finfo.size, + (apr_uint64_t) ctx->finfo.mtime); } - return apr_psprintf(ctx->pool, "\"%lx\"", (unsigned long) ctx->finfo.mtime); + return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "\"", + (apr_uint64_t) ctx->finfo.mtime); } static const dav_hooks_repository dav_hooks_repository_fs =