1
apache_module_dependency: Dynamically bind two mod_dav_svn functions in
2
mod_authz_svn, so that it works even if mod_authz_svn is loaded first.
4
This is related to splitting mod_authz_svn out of dav_svn.load into its
5
own authz_svn.load. Since a2enmod does not reorder modules based on
6
dependencies, mod_authz_svn is loaded first.
8
--- a/subversion/include/mod_dav_svn.h
9
+++ b/subversion/include/mod_dav_svn.h
14
+#include <apr_optional.h>
19
const char **repos_basename,
20
const char **relative_path,
21
const char **repos_path);
22
+APR_DECLARE_OPTIONAL_FN(dav_error *, dav_svn_split_uri,
25
+ const char *root_path,
26
+ const char **cleaned_uri,
27
+ int *trailing_slash,
28
+ const char **repos_name,
29
+ const char **relative_path,
30
+ const char **repos_path));
35
AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
36
const char *root_path,
37
const char **repos_path);
38
+APR_DECLARE_OPTIONAL_FN(dav_error *, dav_svn_get_repos_path,
40
+ const char *root_path,
41
+ const char **repos_path));
45
--- a/subversion/mod_authz_svn/mod_authz_svn.c
46
+++ b/subversion/mod_authz_svn/mod_authz_svn.c
48
* ====================================================================
52
+#define DAV_SVN_LOAD_OPTIONAL 1
55
#include <http_config.h>
57
const char *force_username_case;
58
} authz_svn_config_rec;
60
+#if DAV_SVN_LOAD_OPTIONAL
61
+static APR_OPTIONAL_FN_TYPE(dav_svn_get_repos_path) *get_repos_path;
62
+static APR_OPTIONAL_FN_TYPE(dav_svn_split_uri) *split_uri;
63
+#define dav_svn_get_repos_path get_repos_path
64
+#define dav_svn_split_uri split_uri
74
+#if DAV_SVN_LOAD_OPTIONAL
75
+#undef dav_svn_get_repos_path
76
+#undef dav_svn_split_uri
77
+static void import_dav_svn(void)
79
+ get_repos_path = APR_RETRIEVE_OPTIONAL_FN(dav_svn_get_repos_path);
80
+ split_uri = APR_RETRIEVE_OPTIONAL_FN(dav_svn_split_uri);
88
AUTHZ_SVN__SUBREQ_BYPASS_PROV_NAME,
89
AUTHZ_SVN__SUBREQ_BYPASS_PROV_VER,
90
(void*)subreq_bypass);
91
+#if DAV_SVN_LOAD_OPTIONAL
92
+ ap_hook_optional_fn_retrieve(import_dav_svn,NULL,NULL,APR_HOOK_MIDDLE);
96
module AP_MODULE_DECLARE_DATA authz_svn_module =
97
--- a/subversion/mod_dav_svn/mod_dav_svn.c
98
+++ b/subversion/mod_dav_svn/mod_dav_svn.c
101
register_hooks(apr_pool_t *pconf)
103
+ APR_REGISTER_OPTIONAL_FN(dav_svn_get_repos_path);
104
+ APR_REGISTER_OPTIONAL_FN(dav_svn_split_uri);
106
ap_hook_pre_config(init_dso, NULL, NULL, APR_HOOK_REALLY_FIRST);
107
ap_hook_post_config(init, NULL, NULL, APR_HOOK_MIDDLE);