]> granicus.if.org Git - apache/commitdiff
* Adjust etag generation to produce identical results on 32-bit and 64-bit
authorRuediger Pluem <rpluem@apache.org>
Sat, 29 Dec 2007 16:06:19 +0000 (16:06 +0000)
committerRuediger Pluem <rpluem@apache.org>
Sat, 29 Dec 2007 16:06:19 +0000 (16:06 +0000)
  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 <michael metaparadigm.com>
Reviewed by: rpluem

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607437 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/core.xml
modules/dav/fs/repos.c

diff --git a/CHANGES b/CHANGES
index 748f438277c48ad556a4b2eaab918404f2467c64..5a595df6edeed12f3609d255bee327acb4de6ba0 100644 (file)
--- 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 <michael metaparadigm.com>, Ruediger Pluem]
+
   *) mod_deflate: Transform ETag when transforming the entity.
      PR 39727 [Henrik Nordstrom <hno squid-cache.org>, Nick Kew]
 
index f93defd046bf21f1978be4eee2398e188823a95e..161376ee5b87526b905105742921bc31a3dd2628 100644 (file)
@@ -1115,6 +1115,14 @@ HTTP response header</description>
     the setting for that subdirectory (which will be inherited by
     any sub-subdirectories that don't override it) will be equivalent to
     <code>FileETag&nbsp;MTime&nbsp;Size</code>.</p>
+    <note type="warning"><title>Warning</title>
+    Do not change the default for directories or locations that have WebDAV
+    enabled and use <module>mod_dav_fs</module> as a storage provider.
+    <module>mod_dav_fs</module> uses <code>INode&nbsp;MTime&nbsp;Size</code>
+    as a fixed format for <code>ETag</code> comparisons on conditional requests.
+    These conditional requests will break if the <code>ETag</code> format is
+    changed via <directive>FileETag</directive>.
+    </note>
 </usage>
 </directivesynopsis>
 
index 6ec75d40d84ba5f14bbc5391a7155de55fd5aabf..8b60f37dec511b90ed315f543fe733ae1615478d 100644 (file)
@@ -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 =