You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2007/12/29 17:06:20 UTC

svn commit: r607437 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/core.xml modules/dav/fs/repos.c

Author: rpluem
Date: Sat Dec 29 08:06:19 2007
New Revision: 607437

URL: http://svn.apache.org/viewvc?rev=607437&view=rev
Log:
* 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 <michael metaparadigm.com>
Reviewed by: rpluem

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/core.xml
    httpd/httpd/trunk/modules/dav/fs/repos.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=607437&r1=607436&r2=607437&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat Dec 29 08:06:19 2007
@@ -16,6 +16,11 @@
      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]
 

Modified: httpd/httpd/trunk/docs/manual/mod/core.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.xml?rev=607437&r1=607436&r2=607437&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.xml Sat Dec 29 08:06:19 2007
@@ -1115,6 +1115,14 @@
     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>
 

Modified: httpd/httpd/trunk/modules/dav/fs/repos.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/fs/repos.c?rev=607437&r1=607436&r2=607437&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/fs/repos.c (original)
+++ httpd/httpd/trunk/modules/dav/fs/repos.c Sat Dec 29 08:06:19 2007
@@ -1773,13 +1773,15 @@
         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 =