给apache 2.3.6+用的mod_authz_svn和mod_dav_svn

前段时间升级到apache 2.3.6后mod_authz_svn和mod_dav_svn一直无法使用,直到昨天将apache更新到2.3.7后自己看了一下代码,原来apache有3个API变更了,而我只修改了两处。

变更的API如下,在mod_dav.h中

diff -ru subversion-1.6.12/subversion/mod_dav_svn/activity.c subversion-1.6.12m/subversion/mod_dav_svn/activity.c
--- subversion-1.6.12/subversion/mod_dav_svn/activity.c	2009-01-24 02:30:04 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/activity.c	2010-08-20 23:43:22 +0800
@@ -159,7 +159,7 @@
   txn_name = read_txn(pathname, repos->pool);
   if (txn_name == NULL)
     {
-      return dav_new_error(repos->pool, HTTP_NOT_FOUND, 0,
+      return dav_new_error(repos->pool, HTTP_NOT_FOUND, 0, 0,
                            "could not find activity.");
     }
 
diff -ru subversion-1.6.12/subversion/mod_dav_svn/deadprops.c subversion-1.6.12m/subversion/mod_dav_svn/deadprops.c
--- subversion-1.6.12/subversion/mod_dav_svn/deadprops.c	2008-08-29 23:43:10 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/deadprops.c	2010-08-20 23:43:49 +0800
@@ -144,7 +144,7 @@
         /* ignore the unknown namespace of the incoming prop. */
         propname = name->name;
       else
-        return dav_new_error(db->p, HTTP_CONFLICT, 0,
+        return dav_new_error(db->p, HTTP_CONFLICT, 0, 0,
                              "Properties may only be defined in the "
                              SVN_DAV_PROP_NS_SVN " and " SVN_DAV_PROP_NS_CUSTOM
                              " namespaces.");
@@ -222,7 +222,7 @@
          changing unversioned rev props.  Remove this someday: see IZ #916. */
       if (! (resource->baselined
              && resource->type == DAV_RESOURCE_TYPE_VERSION))
-        return dav_new_error(p, HTTP_CONFLICT, 0,
+        return dav_new_error(p, HTTP_CONFLICT, 0, 0,
                              "Properties may only be changed on working "
                              "resources.");
     }
@@ -378,7 +378,7 @@
           if (enc_type && (strcmp(enc_type, "base64") == 0))
             propval = svn_base64_decode_string(propval, pool);
           else
-            return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+            return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                                  "Unknown property encoding");
           break;
         }
diff -ru subversion-1.6.12/subversion/mod_dav_svn/lock.c subversion-1.6.12m/subversion/mod_dav_svn/lock.c
--- subversion-1.6.12/subversion/mod_dav_svn/lock.c	2008-09-10 05:59:18 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/lock.c	2010-08-20 23:52:12 +0800
@@ -139,7 +139,7 @@
       char errbuf[1024];
       (void)apr_xml_parser_geterror(xml_parser, errbuf, sizeof(errbuf));
       return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR,
-                           DAV_ERR_LOCK_SAVE_LOCK, errbuf);
+                           DAV_ERR_LOCK_SAVE_LOCK, 0, errbuf);
     }
 
   apr_xml_to_text(pool, xml_doc->root, APR_XML_X2T_INNER,
@@ -162,12 +162,12 @@
   /* Sanity checks */
   if (dlock->type != DAV_LOCKTYPE_WRITE)
     return dav_new_error(pool, HTTP_BAD_REQUEST,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Only 'write' locks are supported.");
 
   if (dlock->scope != DAV_LOCKSCOPE_EXCLUSIVE)
     return dav_new_error(pool, HTTP_BAD_REQUEST,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Only exclusive locks are supported.");
 
   lock = svn_lock_create(pool);
@@ -455,7 +455,7 @@
      anything about locks attached to it.*/
   if (! dav_svn__allow_read(resource, SVN_INVALID_REVNUM, resource->pool))
     return dav_new_error(resource->pool, HTTP_FORBIDDEN,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Path is not accessible.");
 
   serr = svn_fs_get_lock(&slock,
@@ -515,7 +515,7 @@
      anything about locks attached to it.*/
   if (! dav_svn__allow_read(resource, SVN_INVALID_REVNUM, resource->pool))
     return dav_new_error(resource->pool, HTTP_FORBIDDEN,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Path is not accessible.");
 
   serr = svn_fs_get_lock(&slock,
@@ -532,7 +532,7 @@
       /* Sanity check. */
       if (strcmp(locktoken->uuid_str, slock->token) != 0)
         return dav_new_error(resource->pool, HTTP_BAD_REQUEST,
-                             DAV_ERR_LOCK_SAVE_LOCK,
+                             DAV_ERR_LOCK_SAVE_LOCK, 0,
                              "Incoming token doesn't match existing lock.");
 
       svn_lock_to_dav_lock(&dlock, slock, FALSE,
@@ -593,7 +593,7 @@
      anything about locks attached to it.*/
   if (! dav_svn__allow_read(resource, SVN_INVALID_REVNUM, resource->pool))
     return dav_new_error(resource->pool, HTTP_FORBIDDEN,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Path is not accessible.");
 
   serr = svn_fs_get_lock(&slock,
@@ -636,12 +636,12 @@
      be created on it. */
   if (! dav_svn__allow_read(resource, SVN_INVALID_REVNUM, resource->pool))
     return dav_new_error(resource->pool, HTTP_FORBIDDEN,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Path is not accessible.");
 
   if (lock->next)
     return dav_new_error(resource->pool, HTTP_BAD_REQUEST,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Tried to attach multiple locks to a resource.");
 
   /* RFC2518bis (section 7.4) doesn't require us to support
@@ -661,13 +661,13 @@
 
       if (resource->info->repos->is_svn_client)
         return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED,
-                             DAV_ERR_LOCK_SAVE_LOCK,
+                             DAV_ERR_LOCK_SAVE_LOCK, 0,
                              "Subversion clients may not lock "
                              "nonexistent paths.");
 
       else if (! resource->info->repos->autoversioning)
         return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED,
-                             DAV_ERR_LOCK_SAVE_LOCK,
+                             DAV_ERR_LOCK_SAVE_LOCK, 0,
                              "Attempted to lock non-existent path;"
                              " turn on autoversioning first.");
 
@@ -738,7 +738,7 @@
     {
       svn_error_clear(serr);
       return dav_new_error(resource->pool, HTTP_UNAUTHORIZED,
-                           DAV_ERR_LOCK_SAVE_LOCK,
+                           DAV_ERR_LOCK_SAVE_LOCK, 0,
                            "Anonymous lock creation is not allowed.");
     }
   else if (serr)
@@ -803,7 +803,7 @@
      be removed from it. */
   if (! dav_svn__allow_read(resource, SVN_INVALID_REVNUM, resource->pool))
     return dav_new_error(resource->pool, HTTP_FORBIDDEN,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Path is not accessible.");
 
   if (locktoken == NULL)
@@ -840,7 +840,7 @@
         {
           svn_error_clear(serr);
           return dav_new_error(resource->pool, HTTP_UNAUTHORIZED,
-                               DAV_ERR_LOCK_SAVE_LOCK,
+                               DAV_ERR_LOCK_SAVE_LOCK, 0,
                                "Anonymous lock removal is not allowed.");
         }
       else if (serr)
@@ -888,7 +888,7 @@
      anything about locks attached to it.*/
   if (! dav_svn__allow_read(resource, SVN_INVALID_REVNUM, resource->pool))
     return dav_new_error(resource->pool, HTTP_FORBIDDEN,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Path is not accessible.");
 
   /* Convert the path into an svn_lock_t. */
@@ -906,7 +906,7 @@
   if ((! slock)
       || (strcmp(token->uuid_str, slock->token) != 0))
     return dav_new_error(resource->pool, HTTP_UNAUTHORIZED,
-                         DAV_ERR_LOCK_SAVE_LOCK,
+                         DAV_ERR_LOCK_SAVE_LOCK, 0,
                          "Lock refresh request doesn't match existing lock.");
 
   /* Now use the tweaked svn_lock_t to 'refresh' the existing lock. */
@@ -926,7 +926,7 @@
     {
       svn_error_clear(serr);
       return dav_new_error(resource->pool, HTTP_UNAUTHORIZED,
-                           DAV_ERR_LOCK_SAVE_LOCK,
+                           DAV_ERR_LOCK_SAVE_LOCK, 0,
                            "Anonymous lock refreshing is not allowed.");
     }
   else if (serr)
diff -ru subversion-1.6.12/subversion/mod_dav_svn/reports/dated-rev.c subversion-1.6.12m/subversion/mod_dav_svn/reports/dated-rev.c
--- subversion-1.6.12/subversion/mod_dav_svn/reports/dated-rev.c	2009-01-20 01:40:50 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/reports/dated-rev.c	2010-08-20 23:53:29 +0800
@@ -75,7 +75,7 @@
 
   if (tm == (apr_time_t) -1)
     {
-      return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0,
+      return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0, 0,
                            "The request does not contain a valid "
                            "'DAV:" SVN_DAV__CREATIONDATE "' element.");
     }
@@ -85,7 +85,7 @@
                                       resource->pool)) != SVN_NO_ERROR)
     {
       svn_error_clear(err);
-      return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+      return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                            "Could not access revision times.");
     }
 
diff -ru subversion-1.6.12/subversion/mod_dav_svn/reports/deleted-rev.c subversion-1.6.12m/subversion/mod_dav_svn/reports/deleted-rev.c
--- subversion-1.6.12/subversion/mod_dav_svn/reports/deleted-rev.c	2009-07-29 08:48:04 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/reports/deleted-rev.c	2010-08-20 23:53:29 +0800
@@ -103,7 +103,7 @@
   if (err)
     {
       svn_error_clear(err);
-      return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+      return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                            "Could not find revision path was deleted.");
     }
 
diff -ru subversion-1.6.12/subversion/mod_dav_svn/reports/get-locks.c subversion-1.6.12m/subversion/mod_dav_svn/reports/get-locks.c
--- subversion-1.6.12/subversion/mod_dav_svn/reports/get-locks.c	2009-02-17 04:35:26 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/reports/get-locks.c	2010-08-20 23:53:29 +0800
@@ -185,7 +185,7 @@
   /* The request URI should be a public one representing an fs path. */
   if ((! resource->info->repos_path)
       || (! resource->info->repos->repos))
-    return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0,
+    return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0, 0,
                          "get-locks-report run on resource which doesn't "
                          "represent a path within a repository.");
 
diff -ru subversion-1.6.12/subversion/mod_dav_svn/repos.c subversion-1.6.12m/subversion/mod_dav_svn/repos.c
--- subversion-1.6.12/subversion/mod_dav_svn/repos.c	2009-10-15 02:05:16 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/repos.c	2010-08-20 23:52:12 +0800
@@ -690,7 +690,7 @@
   if (txn_name == NULL)
     {
       /* ### HTTP_BAD_REQUEST is probably wrong */
-      return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
+      return dav_new_error(pool, HTTP_BAD_REQUEST, 0, 0,
                            "An unknown activity was specified in the URL. "
                            "This is generally caused by a problem in the "
                            "client software.");
@@ -705,7 +705,7 @@
       if (serr->apr_err == SVN_ERR_FS_NO_SUCH_TRANSACTION)
         {
           svn_error_clear(serr);
-          return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+          return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                                "An activity was specified and found, but the "
                                "corresponding SVN FS transaction was not "
                                "found.");
@@ -764,7 +764,7 @@
         }
       else if (!svn_string_compare(current_author, &request_author))
         {
-          return dav_new_error(pool, HTTP_NOT_IMPLEMENTED, 0,
+          return dav_new_error(pool, HTTP_NOT_IMPLEMENTED, 0, 0,
                    "Multi-author commits not supported.");
         }
     }
@@ -854,7 +854,7 @@
         return (*scan->prep)(comb);
     }
 
-  return dav_new_error(comb->res.pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+  return dav_new_error(comb->res.pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                        "DESIGN FAILURE: unknown resource type");
 }
 
@@ -939,7 +939,7 @@
     {
       /* ### are SVN_ERR_APMOD codes within the right numeric space? */
       return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                           SVN_ERR_APMOD_MISSING_PATH_TO_FS,
+                           SVN_ERR_APMOD_MISSING_PATH_TO_FS, 0,
                            "The server is misconfigured: "
                            "either an SVNPath or SVNParentPath "
                            "directive is required to specify the location "
@@ -1022,7 +1022,7 @@
         {
           /* ### are SVN_ERR_APMOD codes within the right numeric space? */
           return dav_new_error(r->pool, HTTP_FORBIDDEN,
-                               SVN_ERR_APMOD_MALFORMED_URI,
+                               SVN_ERR_APMOD_MALFORMED_URI, 0,
                                "The URI does not contain the name "
                                "of a repository.");
         }
@@ -1070,7 +1070,7 @@
           {
             /* relative is just "!svn", which is malformed. */
             return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                                 SVN_ERR_APMOD_MALFORMED_URI,
+                                 SVN_ERR_APMOD_MALFORMED_URI, 0,
                                  "Nothing follows the svn special_uri.");
           }
         else
@@ -1097,7 +1097,7 @@
                         else
                           return
                             dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                                          SVN_ERR_APMOD_MALFORMED_URI,
+                                          SVN_ERR_APMOD_MALFORMED_URI, 0,
                                           "Missing info after special_uri.");
                       }
                     else if (relative[len3] == '/')
@@ -1122,7 +1122,7 @@
                               return
                                 dav_new_error(r->pool,
                                               HTTP_INTERNAL_SERVER_ERROR,
-                                              SVN_ERR_APMOD_MALFORMED_URI,
+                                              SVN_ERR_APMOD_MALFORMED_URI, 0,
                                               "Not enough components"
                                               " after special_uri.");
 
@@ -1142,7 +1142,7 @@
                       {
                         return
                           dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                                        SVN_ERR_APMOD_MALFORMED_URI,
+                                        SVN_ERR_APMOD_MALFORMED_URI, 0,
                                         "Unknown data after special_uri.");
                       }
 
@@ -1153,7 +1153,7 @@
             if (defn->name == NULL)
               return
                 dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                              SVN_ERR_APMOD_MALFORMED_URI,
+                              SVN_ERR_APMOD_MALFORMED_URI, 0,
                               "Couldn't match subdir after special_uri.");
           }
       }
@@ -1241,7 +1241,7 @@
                             "/", NULL);
       apr_table_setn(r->headers_out, "Location",
                      ap_construct_url(r->pool, new_uri, r));
-      return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
+      return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0, 0,
                            "Requests for a collection must have a "
                            "trailing slash on the URI.");
     }
@@ -1511,7 +1511,7 @@
     {
       peg_rev = SVN_STR_TO_REV(prevstr);
       if (!SVN_IS_VALID_REVNUM(peg_rev))
-        return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
+        return dav_new_error(pool, HTTP_BAD_REQUEST, 0, 0,
                              "invalid peg rev in query string");
     }
   else
@@ -1528,7 +1528,7 @@
     {
       working_rev = SVN_STR_TO_REV(wrevstr);
       if (!SVN_IS_VALID_REVNUM(working_rev))
-        return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
+        return dav_new_error(pool, HTTP_BAD_REQUEST, 0, 0,
                              "invalid working rev in query string");
     }
   else
@@ -1542,7 +1542,7 @@
      Our node-tracing algorithms can't handle that scenario, so we'll
      disallow it here. */
   if (working_rev > peg_rev)
-    return dav_new_error(pool, HTTP_BAD_REQUEST, 0,
+    return dav_new_error(pool, HTTP_BAD_REQUEST, 0, 0,
                          "working rev greater than peg rev.");
 
   /* If WORKING_REV and PEG_REV are equivalent, we want to return the
@@ -1584,7 +1584,7 @@
 
       newpath = apr_hash_get(locations, &working_rev, sizeof(svn_revnum_t));
       if (! newpath)
-        return dav_new_error(pool, HTTP_NOT_FOUND, 0,
+        return dav_new_error(pool, HTTP_NOT_FOUND, 0, 0,
                              "path doesn't exist in that revision.");
 
       /* Redirect folks to a canonical, peg-revision-only location.
@@ -1599,7 +1599,7 @@
                                       r));
       return dav_new_error(r->pool,
                            prevstr ? HTTP_MOVED_PERMANENTLY
-                                   : HTTP_MOVED_TEMPORARILY,
+                                   : HTTP_MOVED_TEMPORARILY, 0,
                            0, "redirecting to canonical location");
     }
 
@@ -1993,7 +1993,7 @@
                                          NULL);
       apr_table_setn(r->headers_out, "Location",
                      ap_construct_url(r->pool, new_path, r));
-      return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
+      return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0, 0,
                            "Requests for a collection must have a "
                            "trailing slash on the URI.");
     }
@@ -2008,7 +2008,7 @@
   /* ### pick something other than HTTP_INTERNAL_SERVER_ERROR */
   /* ### are SVN_ERR_APMOD codes within the right numeric space? */
   return dav_new_error(r->pool, HTTP_INTERNAL_SERVER_ERROR,
-                       SVN_ERR_APMOD_MALFORMED_URI,
+                       SVN_ERR_APMOD_MALFORMED_URI, 0,
                        "The URI indicated a resource within Subversion's "
                        "special resource area, but does not exist. This is "
                        "generally caused by a problem in the client "
@@ -2105,7 +2105,7 @@
          ###
          ### return an error so we can easily identify the cases where
          ### we've called this function unexpectedly. */
-      return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+      return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                            apr_psprintf(resource->pool,
                                         "get_parent_resource was called for "
                                         "%s (type %d)",
@@ -2330,7 +2330,7 @@
     {
       if (resource->type != DAV_RESOURCE_TYPE_WORKING)
         {
-          return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+          return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
                                "Resource body changes may only be made to "
                                "working resources [at this time].");
         }
@@ -2339,7 +2339,7 @@
 #if 1
   if (mode == DAV_MODE_WRITE_SEEKABLE)
     {
-      return dav_new_error(resource->pool, HTTP_NOT_IMPLEMENTED, 0,
+      return dav_new_error(resource->pool, HTTP_NOT_IMPLEMENTED, 0, 0,
                            "Resource body writes cannot use ranges "
                            "[at this time].");
     }
@@ -2534,7 +2534,7 @@
 {
   /* ### fill this in */
 
-  return dav_new_error(stream->res->pool, HTTP_NOT_IMPLEMENTED, 0,
+  return dav_new_error(stream->res->pool, HTTP_NOT_IMPLEMENTED, 0, 0,
                        "Resource body read/write cannot use ranges "
                        "(at this time)");
 }
@@ -2830,7 +2830,7 @@
       && resource->type != DAV_RESOURCE_TYPE_WORKING
       && resource->info->restype != DAV_SVN_RESTYPE_PARENTPATH_COLLECTION)
     {
-      return dav_new_error(resource->pool, HTTP_CONFLICT, 0,
+      return dav_new_error(resource->pool, HTTP_CONFLICT, 0, 0,
                            "Cannot GET this type of resource.");
     }
 
@@ -3121,7 +3121,7 @@
       bkt = apr_bucket_eos_create(output->c->bucket_alloc);
       APR_BRIGADE_INSERT_TAIL(bb, bkt);
       if ((status = ap_pass_brigade(output, bb)) != APR_SUCCESS)
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                              "Could not write EOS to filter.");
 
       return NULL;
@@ -3168,7 +3168,7 @@
                                         "is really a file",
                                         resource->pool);
           if (!is_file)
-            return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0,
+            return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0, 0,
                                  "the delta base does not refer to a file");
 
           /* Okay. Let's open up a delta stream for the client to read. */
@@ -3255,7 +3255,7 @@
         APR_BRIGADE_INSERT_TAIL(bb, bkt);
         if ((status = ap_pass_brigade(output, bb)) != APR_SUCCESS) {
           /* ### what to do with status; and that HTTP code... */
-          return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+          return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                                "Could not write data to filter.");
         }
       }
@@ -3266,7 +3266,7 @@
       APR_BRIGADE_INSERT_TAIL(bb, bkt);
       if ((status = ap_pass_brigade(output, bb)) != APR_SUCCESS) {
         /* ### what to do with status; and that HTTP code... */
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                              "Could not write EOS to filter.");
       }
 
@@ -3284,7 +3284,7 @@
   if (resource->type != DAV_RESOURCE_TYPE_WORKING
       && resource->type != DAV_RESOURCE_TYPE_REGULAR)
     {
-      return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+      return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
                            "Collections can only be created within a working "
                            "or regular collection [at this time].");
     }
@@ -3292,7 +3292,7 @@
   /* ...regular resources allowed only if autoversioning is turned on. */
   if (resource->type == DAV_RESOURCE_TYPE_REGULAR
       && ! (resource->info->repos->autoversioning))
-    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
                          "MKCOL called on regular resource, but "
                          "autoversioning is not active.");
 
@@ -3364,12 +3364,12 @@
      a new baseline afterwards.  We need to safeguard here that nobody
      is calling COPY with the baseline as a Destination! */
   if (dst->baselined && dst->type == DAV_RESOURCE_TYPE_VERSION)
-    return dav_new_error(src->pool, HTTP_PRECONDITION_FAILED, 0,
+    return dav_new_error(src->pool, HTTP_PRECONDITION_FAILED, 0, 0,
                          "Illegal: COPY Destination is a baseline.");
 
   if (dst->type == DAV_RESOURCE_TYPE_REGULAR
       && !(dst->info->repos->autoversioning))
-    return dav_new_error(dst->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+    return dav_new_error(dst->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
                          "COPY called on regular resource, but "
                          "autoversioning is not active.");
 
@@ -3437,13 +3437,13 @@
   if (resource->type != DAV_RESOURCE_TYPE_WORKING
       && resource->type != DAV_RESOURCE_TYPE_REGULAR
       && resource->type != DAV_RESOURCE_TYPE_ACTIVITY)
-    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
                            "DELETE called on invalid resource type.");
 
   /* ...and regular resources only if autoversioning is turned on. */
   if (resource->type == DAV_RESOURCE_TYPE_REGULAR
       && ! (resource->info->repos->autoversioning))
-    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+    return dav_new_error(resource->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
                          "DELETE called on regular resource, but "
                          "autoversioning is not active.");
 
@@ -3567,7 +3567,7 @@
   if (src->type != DAV_RESOURCE_TYPE_REGULAR
       || dst->type != DAV_RESOURCE_TYPE_REGULAR
       || !(src->info->repos->autoversioning))
-    return dav_new_error(dst->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+    return dav_new_error(dst->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
                          "MOVE only allowed on two public URIs, and "
                          "autoversioning must be active.");
 
@@ -3661,7 +3661,7 @@
   /* ### need to allow more walking in the future */
   if (params->root->type != DAV_RESOURCE_TYPE_REGULAR)
     {
-      return dav_new_error(params->pool, HTTP_METHOD_NOT_ALLOWED, 0,
+      return dav_new_error(params->pool, HTTP_METHOD_NOT_ALLOWED, 0, 0,
                            "Walking the resource hierarchy can only be done "
                            "on 'regular' resources [at this time].");
     }
@@ -3954,7 +3954,7 @@
 
   result = parse_version_uri(comb, uri, NULL, 0);
   if (result != 0)
-    return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+    return dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                          "Could not parse version resource uri.");
 
   err = prep_version(comb);
diff -ru subversion-1.6.12/subversion/mod_dav_svn/util.c subversion-1.6.12m/subversion/mod_dav_svn/util.c
--- subversion-1.6.12/subversion/mod_dav_svn/util.c	2009-02-02 23:56:44 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/util.c	2010-08-20 23:52:12 +0800
@@ -45,7 +45,7 @@
      valid information. */
   errno = 0;
 
-  return dav_new_error_tag(pool, status, error_id, desc, namespace, tagname);
+  return dav_new_error_tag(pool, status, error_id, 0, desc, namespace, tagname);
 }
 
@@ -518,7 +518,7 @@
     {
       apr_status_t apr_err = ap_fflush(output, bb);
       if (apr_err && (! derr))
-        derr = dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+        derr = dav_new_error(pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                              "Error flushing brigade.");
     }
   return derr;
diff -ru subversion-1.6.12/subversion/mod_dav_svn/version.c subversion-1.6.12m/subversion/mod_dav_svn/version.c
--- subversion-1.6.12/subversion/mod_dav_svn/version.c	2008-11-03 11:15:18 +0800
+++ subversion-1.6.12m/subversion/mod_dav_svn/version.c	2010-08-20 23:52:45 +0800
@@ -78,7 +78,7 @@
 
   if (! (resource->type == DAV_RESOURCE_TYPE_WORKING
          && resource->info->auto_checked_out))
-    return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+    return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                          "Set_auto_revprops called on invalid resource.");
 
   if ((serr = dav_svn__attach_auto_revprops(resource->info->root.txn,
@@ -231,7 +231,7 @@
   /* All mod_dav_svn resources are versioned objects;  so it doesn't
      make sense to call vsn_control on a resource that exists . */
   if (resource->exists)
-    return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0,
+    return dav_new_error(resource->pool, HTTP_BAD_REQUEST, 0, 0,
                          "vsn_control called on already-versioned resource.");
 
   /* Only allow a NULL target, which means an create an 'empty' VCR. */
@@ -344,7 +344,7 @@
           shared_txn_name = dav_svn__get_txn(resource->info->repos,
                                              shared_activity);
           if (! shared_txn_name)
-            return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+            return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                                  "Cannot look up a txn_name by activity");
         }
 
@@ -820,19 +820,19 @@
       shared_txn_name = dav_svn__get_txn(resource->info->repos,
                                          shared_activity);
       if (! shared_txn_name)
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                              "Cannot look up a txn_name by activity");
 
       /* Sanity checks */
       if (resource->info->root.txn_name
           && (strcmp(shared_txn_name, resource->info->root.txn_name) != 0))
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                              "Internal txn_name doesn't match"
                              " autoversioning transaction.");
 
       if (! resource->info->root.txn)
         /* should already be open by checkout */
-        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0,
+        return dav_new_error(resource->pool, HTTP_INTERNAL_SERVER_ERROR, 0, 0,
                              "Autoversioning txn isn't open "
                              "when it should be.");

变更为

DAV_DECLARE(dav_error*) dav_new_error(apr_pool_t *p, int status,
                                      int error_id, apr_status_t aprerr,
                                      const char *desc);
DAV_DECLARE(dav_error*) dav_new_error_tag(apr_pool_t *p, int status,
                                          int error_id, const char *desc,
                                          const char *namespace,
                                          const char *tagname);

变更为

DAV_DECLARE(dav_error*) dav_new_error_tag(apr_pool_t *p, int status,
                                          int error_id, apr_status_t aprerr,
                                          const char *desc,
                                          const char *namespace,
                                          const char *tagname);

在http_log.h中

AP_DECLARE(void) ap_log_cerror(const char *file, int line, int level,
                               apr_status_t status, const conn_rec *c,
                               const char *fmt, ...)
			    __attribute__((format(printf,6,7)));
#if __STDC_VERSION__ >= 199901L
/* need additional step to expand APLOG_MARK first */
#define ap_log_cerror(...) ap_log_cerror__(__VA_ARGS__)
#define ap_log_cerror__(file, line, mi, level, status, c, ...)              \
    do { if (APLOG_C_MODULE_IS_LEVEL(c, mi, level))                         \
             ap_log_cerror_(file, line, mi, level, status, c, __VA_ARGS__); \
    } while(0)
#else
#define ap_log_cerror ap_log_cerror_
#endif
AP_DECLARE(void) ap_log_cerror_(const char *file, int line, int module_level,
                                int level, apr_status_t status,
                                const conn_rec *c, const char *fmt, ...)
			    __attribute__((format(printf,7,8)));

一共三处地方。

mod_dav.h中增加了一个apr_status_t aprerr的参数,这个改期来很方便,从apache自身代码变更可以看出这个参数只需要填0即可。

而http_log.h中看起来多了不少代码,实际上是增加了int module_level的参数,这个稍微麻烦一点,仔细看mod_authz_svn发现它用log_access_verdict wrapper了ap_log_rerror,置需要给log_access_verdict增加一个module_index的参数在第三位即可(因为APLOG_MARK宏也发生了变更展开由__FILE__,__LINE__变为__FILE__,__LINE__,APLOG_MODULE_INDEX,APLOG_MARK是log_access_verdict/ap_log_rerror的第一个参数)。

有了以上的东西就知道怎么修改mod_authz_svn和mod_dav_svn的代码了。下面提供subversion 1.6.12中的补丁。

昨天check out到了apache 2.3.7没有看到alpha的字样,估计正式版快出来了,届时subversion应该也会更新吧,毕竟subversion已经进入apache基金了。

mod_authz_svn的patch

diff -ru subversion-1.6.12/subversion/mod_authz_svn/mod_authz_svn.c subversion-1.6.12m/subversion/mod_authz_svn/mod_authz_svn.c
--- subversion-1.6.12/subversion/mod_authz_svn/mod_authz_svn.c	2008-06-17 23:20:52 +0800
+++ subversion-1.6.12m/subversion/mod_authz_svn/mod_authz_svn.c	2010-08-21 01:45:12 +0800
@@ -435,7 +435,7 @@
  * ALLOWED is boolean.  REPOS_PATH and DEST_REPOS_PATH are information
  * about the request.  DEST_REPOS_PATH may be NULL. */
 static void
-log_access_verdict(const char *file, int line,
+log_access_verdict(const char *file, int line, int module_index,
                    const request_rec *r, int allowed,
                    const char *repos_path, const char *dest_repos_path)
 {
@@ -445,22 +445,22 @@
   if (r->user)
     {
       if (dest_repos_path)
-        ap_log_rerror(file, line, level, 0, r,
+        ap_log_rerror(file, line, level, module_index, 0, r,
                       "Access %s: '%s' %s %s %s", verdict, r->user,
                       r->method, repos_path, dest_repos_path);
       else
-        ap_log_rerror(file, line, level, 0, r,
+        ap_log_rerror(file, line, level, module_index, 0, r,
                       "Access %s: '%s' %s %s", verdict, r->user,
                       r->method, repos_path);
     }
   else
     {
       if (dest_repos_path)
-        ap_log_rerror(file, line, level, 0, r,
+        ap_log_rerror(file, line, level, module_index, 0, r,
                       "Access %s: - %s %s %s", verdict,
                       r->method, repos_path, dest_repos_path);
       else
-        ap_log_rerror(file, line, level, 0, r,
+        ap_log_rerror(file, line, level, module_index, 0, r,
                       "Access %s: - %s %s", verdict,
                       r->method, repos_path);
     }
此条目发表在分类目录,贴了, , , 标签。将固定链接加入收藏夹。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据