Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mod_dav_svn: Use mod_dav's DAVBasePath setting #28

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/autoconf.yml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I already added something very similar in r1923964/r1923965, didn't notice this was already included in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah great, looks perfect.

Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,11 @@ jobs:
- name: Run tests
run: make ${{matrix.check-target}} PARALLEL=16 APACHE_MPM=event

- uses: actions/upload-artifact@v4
if: failure()
with:
name: tests.log-${{ github.run_id }}-${{ github.run_attempt }}
path: tests.log

- name: Install (make install)
run: sudo make install
11 changes: 10 additions & 1 deletion subversion/mod_dav_svn/mod_dav_svn.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,15 @@ const char *
dav_svn__get_root_dir(request_rec *r)
{
dir_conf_t *conf;
const char *base;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason why base isn't declared within the #if block?

If compiled with < 20211221.28, there is a compiler warning about an unused variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks good catch!

#if AP_MODULE_MAGIC_AT_LEAST(20211221, 28)
/* Inherit the root path from mod_dav's DavBasePath iff configured
where e.g. LocationMatch is used for the repos. */
base = dav_get_base_path(r);
if (base)
return base;
#endif

conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
return conf->root_dir;
Expand Down Expand Up @@ -1225,7 +1234,7 @@ static int dav_svn__translate_name(request_rec *r)
else
{
/* Retrieve path to repo and within repo for the request */
dav_error *err = dav_svn_split_uri(r, r->uri, conf->root_dir,
dav_error *err = dav_svn_split_uri(r, r->uri, dav_svn__get_root_dir(r),
&ignore_cleaned_uri,
&ignore_had_slash, &repos_basename,
&ignore_relative_path, &repos_path);
Expand Down