From: Ruediger Pluem Date: Sat, 29 Dec 2007 16:06:19 +0000 (+0000) Subject: * Adjust etag generation to produce identical results on 32-bit and 64-bit X-Git-Tag: 2.3.0~1081 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0260bcb6ba9e04aa4fea87647c6ab198d8b6e025;p=apache * 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 Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607437 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 748f438277..5a595df6ed 100644 --- a/CHANGES +++ b/CHANGES @@ -16,6 +16,11 @@ Changes with Apache 2.3.0 Prevent crash in balancer manager if invalid balancer name is passed as parameter. Reported by SecurityReason. [Ruediger Pluem] + *) 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] + *) mod_deflate: Transform ETag when transforming the entity. PR 39727 [Henrik Nordstrom , Nick Kew] diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index f93defd046..161376ee5b 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -1115,6 +1115,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 6ec75d40d8..8b60f37dec 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -1773,13 +1773,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 =