summaryrefslogtreecommitdiff
path: root/debian/patches/apache_module_dependency
blob: 4c4ab11d25dff1333b6ebae123f6a3bf2219e132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
apache_module_dependency: Dynamically bind two mod_dav_svn functions in
mod_authz_svn, so that it works even if mod_authz_svn is loaded first.

This is related to splitting mod_authz_svn out of dav_svn.load into its
own authz_svn.load.  Since a2enmod does not reorder modules based on
dependencies, mod_authz_svn is loaded first.

--- a/subversion/include/mod_dav_svn.h
+++ b/subversion/include/mod_dav_svn.h
@@ -30,6 +30,7 @@
 
 #include <httpd.h>
 #include <mod_dav.h>
+#include <apr_optional.h>
 
 
 #ifdef __cplusplus
@@ -101,6 +102,15 @@
                                                  const char **repos_basename,
                                                  const char **relative_path,
                                                  const char **repos_path);
+APR_DECLARE_OPTIONAL_FN(dav_error *, dav_svn_split_uri,
+                        (request_rec *r,
+                         const char *uri,
+                         const char *root_path,
+                         const char **cleaned_uri,
+                         int *trailing_slash,
+                         const char **repos_name,
+                         const char **relative_path,
+                         const char **repos_path));
 
 
 /**
@@ -124,6 +134,10 @@
 AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
                                                       const char *root_path,
                                                       const char **repos_path);
+APR_DECLARE_OPTIONAL_FN(dav_error *, dav_svn_get_repos_path,
+                        (request_rec *r,
+                         const char *root_path,
+                         const char **repos_path));
 
 #ifdef __cplusplus
 }
--- a/subversion/mod_authz_svn/mod_authz_svn.c
+++ b/subversion/mod_authz_svn/mod_authz_svn.c
@@ -22,7 +22,7 @@
  * ====================================================================
  */
 
-
+#define DAV_SVN_LOAD_OPTIONAL 1
 
 #include <httpd.h>
 #include <http_config.h>
@@ -67,6 +67,13 @@
   const char *force_username_case;
 } authz_svn_config_rec;
 
+#if DAV_SVN_LOAD_OPTIONAL
+static APR_OPTIONAL_FN_TYPE(dav_svn_get_repos_path) *get_repos_path;
+static APR_OPTIONAL_FN_TYPE(dav_svn_split_uri) *split_uri;
+#define dav_svn_get_repos_path get_repos_path
+#define dav_svn_split_uri split_uri
+#endif
+
 /*
  * Configuration
  */
@@ -949,6 +956,16 @@
   return OK;
 }
 
+#if DAV_SVN_LOAD_OPTIONAL
+#undef dav_svn_get_repos_path
+#undef dav_svn_split_uri
+static void import_dav_svn(void)
+{
+  get_repos_path = APR_RETRIEVE_OPTIONAL_FN(dav_svn_get_repos_path);
+  split_uri = APR_RETRIEVE_OPTIONAL_FN(dav_svn_split_uri);
+}
+#endif
+
 /*
  * Module flesh
  */
@@ -970,6 +987,9 @@
                        AUTHZ_SVN__SUBREQ_BYPASS_PROV_NAME,
                        AUTHZ_SVN__SUBREQ_BYPASS_PROV_VER,
                        (void*)subreq_bypass);
+#if DAV_SVN_LOAD_OPTIONAL
+  ap_hook_optional_fn_retrieve(import_dav_svn,NULL,NULL,APR_HOOK_MIDDLE);
+#endif
 }
 
 module AP_MODULE_DECLARE_DATA authz_svn_module =
--- a/subversion/mod_dav_svn/mod_dav_svn.c
+++ b/subversion/mod_dav_svn/mod_dav_svn.c
@@ -1394,6 +1394,9 @@
 static void
 register_hooks(apr_pool_t *pconf)
 {
+  APR_REGISTER_OPTIONAL_FN(dav_svn_get_repos_path);
+  APR_REGISTER_OPTIONAL_FN(dav_svn_split_uri);
+
   ap_hook_pre_config(init_dso, NULL, NULL, APR_HOOK_REALLY_FIRST);
   ap_hook_post_config(init, NULL, NULL, APR_HOOK_MIDDLE);