You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2012/04/21 06:01:43 UTC

svn commit: r1328578 - in /subversion/branches/1.7.x: ./ STATUS subversion/include/private/svn_repos_private.h subversion/libsvn_fs/fs-loader.c subversion/libsvn_repos/repos.c subversion/mod_dav_svn/repos.c

Author: svn-role
Date: Sat Apr 21 04:01:42 2012
New Revision: 1328578

URL: http://svn.apache.org/viewvc?rev=1328578&view=rev
Log:
Merge the r1327979 group from trunk:

 * r1327979, r1328002, r1328038, r1328144
   Avoid issue 4157: Disallow BDB with the event MPM at runtime.
   Justication:
     BDB/event causes Apache 2.4 to SEGV or spin
   Votes:
     +1: philip, danielsh, rhuijben

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/include/private/svn_repos_private.h
    subversion/branches/1.7.x/subversion/libsvn_fs/fs-loader.c
    subversion/branches/1.7.x/subversion/libsvn_repos/repos.c
    subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1327979,1328002,1328038,1328144

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1328578&r1=1328577&r2=1328578&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Sat Apr 21 04:01:42 2012
@@ -137,10 +137,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1327979, r1328002, r1328038, r1328144
-   Avoid issue 4157: Disallow BDB with the event MPM at runtime.
-   Justication:
-     BDB/event causes Apache 2.4 to SEGV or spin
-   Votes:
-     +1: philip, danielsh, rhuijben

Modified: subversion/branches/1.7.x/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/include/private/svn_repos_private.h?rev=1328578&r1=1328577&r2=1328578&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/1.7.x/subversion/include/private/svn_repos_private.h Sat Apr 21 04:01:42 2012
@@ -73,6 +73,12 @@ const char *
 svn_repos__post_commit_error_str(svn_error_t *err,
                                  apr_pool_t *pool);
 
+/* A repos version of svn_fs_type */
+svn_error_t *
+svn_repos__fs_type(const char **fs_type,
+                   const char *repos_path,
+                   apr_pool_t *pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/1.7.x/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_fs/fs-loader.c?rev=1328578&r1=1328577&r2=1328578&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_fs/fs-loader.c Sat Apr 21 04:01:42 2012
@@ -235,14 +235,27 @@ svn_fs_type(const char **fs_type, const 
   apr_size_t len;
 
   /* Read the fsap-name file to get the FSAP name, or assume the (old)
-     default. */
+     default.  For old repositories I suppose we could check some
+     other file, DB_CONFIG or strings say, but for now just check the
+     directory exists. */
   filename = svn_dirent_join(path, FS_TYPE_FILENAME, pool);
   err = svn_io_file_open(&file, filename, APR_READ|APR_BUFFERED, 0, pool);
   if (err && APR_STATUS_IS_ENOENT(err->apr_err))
     {
-      svn_error_clear(err);
-      *fs_type = apr_pstrdup(pool, SVN_FS_TYPE_BDB);
-      return SVN_NO_ERROR;
+      svn_node_kind_t kind;
+      svn_error_t *err2 = svn_io_check_path(path, &kind, pool);
+      if (err2)
+        {
+          svn_error_clear(err2);
+          return err;
+        }
+      if (kind == svn_node_dir)
+        {
+          svn_error_clear(err);
+          *fs_type = SVN_FS_TYPE_BDB;
+          return SVN_NO_ERROR;
+        }
+      return err;
     }
   else if (err)
     return err;

Modified: subversion/branches/1.7.x/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_repos/repos.c?rev=1328578&r1=1328577&r2=1328578&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_repos/repos.c Sat Apr 21 04:01:42 2012
@@ -1875,3 +1875,17 @@ svn_repos_remember_client_capabilities(s
   return SVN_NO_ERROR;
 }
 
+svn_error_t *
+svn_repos__fs_type(const char **fs_type,
+                   const char *repos_path,
+                   apr_pool_t *pool)
+{
+  svn_repos_t repos;
+  repos.path = (char*)repos_path;
+
+  SVN_ERR(check_repos_format(&repos, pool));
+
+  return svn_fs_type(fs_type,
+                     svn_dirent_join(repos_path, SVN_REPOS__DB_DIR, pool),
+                     pool);
+}

Modified: subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c?rev=1328578&r1=1328577&r2=1328578&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c Sat Apr 21 04:01:42 2012
@@ -34,6 +34,9 @@
 #include <http_core.h>  /* for ap_construct_url */
 #include <mod_dav.h>
 
+#define CORE_PRIVATE      /* To make ap_show_mpm public in 2.2 */
+#include <http_config.h>
+
 #include "svn_types.h"
 #include "svn_pools.h"
 #include "svn_error.h"
@@ -50,6 +53,7 @@
 #include "svn_dirent_uri.h"
 #include "private/svn_log.h"
 #include "private/svn_fspath.h"
+#include "private/svn_repos_private.h"
 
 #include "dav_svn.h"
 
@@ -2142,6 +2146,8 @@ get_resource(request_rec *r,
   repos->repos = userdata;
   if (repos->repos == NULL)
     {
+      const char *fs_type;
+
       /* construct FS configuration parameters */
       fs_config = apr_hash_make(r->connection->pool);
       apr_hash_set(fs_config,
@@ -2153,9 +2159,29 @@ get_resource(request_rec *r,
                    APR_HASH_KEY_STRING,
                    dav_svn__get_fulltext_cache_flag(r) ? "1" : "0");
 
+      /* Disallow BDB/event until issue 4157 is fixed. */
+      if (!strcmp(ap_show_mpm(), "event"))
+        {
+          serr = svn_repos__fs_type(&fs_type, fs_path, r->connection->pool);
+          if (serr)
+            {
+              /* svn_repos_open2 is going to fail, use that error. */
+              svn_error_clear(serr);
+              serr = NULL;
+            }
+          else if (!strcmp(fs_type, "bdb"))
+            serr = svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+                                     "BDB repository at '%s' is not compatible "
+                                     "with event MPM",
+                                     fs_path);
+        }
+      else
+        serr = NULL;
+
       /* open the FS */
-      serr = svn_repos_open2(&(repos->repos), fs_path, fs_config,
-                             r->connection->pool);
+      if (!serr)
+        serr = svn_repos_open2(&(repos->repos), fs_path, fs_config,
+                               r->connection->pool);
       if (serr != NULL)
         {
           /* The error returned by svn_repos_open2 might contain the