From 35b6d7d408e520a2d2770ad23004b1346e19f039 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Mon, 29 Jul 2024 08:40:42 +0000 Subject: [PATCH 1/9] * modules/dav/fs/repos.c (dav_fs_get_resource): Return a 404 rather than a 400 where r->path_info is not empty for a file; a valid but unsatisfiable request to a path which cannot exist, e.g. /dav/foo.txt/blah where /dav/foo.txt is not a directory. Github: closes #465 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1919580 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit a288cd39ce2f0e05f1cb3e41aa83a9f173ded1e3) --- modules/dav/fs/repos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index 832dca9e34e..b2e9ee5cfc6 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -797,10 +797,10 @@ static dav_error * dav_fs_get_resource( { /* ** The base of the path refers to a file -- nothing should - ** be in path_info. The resource is simply an error: it + ** be in path_info. The resource cannot exist: it ** can't be a null or a locknull resource. */ - return dav_new_error(r->pool, HTTP_BAD_REQUEST, 0, 0, + return dav_new_error(r->pool, HTTP_NOT_FOUND, 0, 0, "The URL contains extraneous path " "components. The resource could not " "be identified."); From 6765ebc5c41d842dab52b68ca4506eaf0454d9f5 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 14 Feb 2025 16:08:23 +0000 Subject: [PATCH 2/9] mod_dav: Fix error handling for dav_fs_dir_file_name(): dav_fs_dir_file_name() will not set *fname_p to NULL on failure, and all callers of dav_fs_dir_file_name() does not check the return value of dav_fs_dir_file_name(), which could lead to an undefined behavior against fname_p. Fix this by adding return value check of dav_fs_dir_file_name() Submitted by: Zhou Qingyang Github: closes #309 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923813 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit 1e298ddfca45386ee95e866abf439ed7f022b562) --- modules/dav/fs/repos.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index b2e9ee5cfc6..9ba7b265edb 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -569,8 +569,13 @@ static dav_error *dav_fs_copymoveset(int is_move, apr_pool_t *p, /* Get directory and filename for resources */ /* ### should test these result values... */ - (void) dav_fs_dir_file_name(src, &src_dir, &src_file); - (void) dav_fs_dir_file_name(dst, &dst_dir, &dst_file); + err = dav_fs_dir_file_name(src, &src_dir, &src_file); + if (err != NULL) + return err; + + err = dav_fs_dir_file_name(dst, &dst_dir, &dst_file); + if (err != NULL) + return err; /* Get the corresponding state files for each resource */ dav_dbm_get_statefiles(p, src_file, &src_state1, &src_state2); @@ -618,11 +623,14 @@ static dav_error *dav_fs_deleteset(apr_pool_t *p, const dav_resource *resource) const char *state1; const char *state2; const char *pathname; + dav_error *err; apr_status_t status; /* Get directory, filename, and state-file names for the resource */ /* ### should test this result value... */ - (void) dav_fs_dir_file_name(resource, &dirpath, &fname); + err = dav_fs_dir_file_name(resource, &dirpath, &fname); + if (err != NULL) + return err; dav_dbm_get_statefiles(p, fname, &state1, &state2); /* build the propset pathname for the file */ From f24c600b110e9f87333d54b1fa4ded3708007397 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 16 Sep 2026 18:38:59 +0000 Subject: [PATCH 3/9] * modules/dav/fs/repos.c (dav_fs_copymove_file): Log the pathname when opening the source or destination file fails. Suggested by: Bingyu Shen Co-Authored-By: Claude Opus 5 (1M context) GitHub: closes #143, closes #760 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1938296 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit 1c838de136b4cbeac80b8a6d0d23c13e3b0d33d4) --- modules/dav/fs/repos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index 9ba7b265edb..6fd6834e7c0 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -364,6 +364,8 @@ static dav_error * dav_fs_copymove_file( if ((status = apr_file_open(&inf, src, APR_READ | APR_BINARY, APR_OS_DEFAULT, p)) != APR_SUCCESS) { + ap_log_perror(APLOG_MARK, APLOG_ERR, status, p, APLOGNO(10629) + "Could not open file %s for reading.", src); /* ### use something besides 500? */ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, status, "Could not open file for reading"); @@ -375,6 +377,8 @@ static dav_error * dav_fs_copymove_file( if (status != APR_SUCCESS) { apr_file_close(inf); + ap_log_perror(APLOG_MARK, APLOG_ERR, status, p, APLOGNO(10630) + "Could not open file %s for writing.", dst); return dav_new_error(p, MAP_IO2HTTP(status), 0, status, "Could not open file for writing"); } From cd9e98880db3b1b008b25ac834a1b59c307fde86 Mon Sep 17 00:00:00 2001 From: Arturo Bernal Date: Fri, 16 Oct 2026 09:01:44 +0000 Subject: [PATCH 4/9] Merge r1939146 from trunk (test changes already on 2.4.x): mod_dav: Do not advertise disabled TRACE dav_method_options() builds its own Allow field and unconditionally advertised TRACE for existing DAV resources, even when TraceEnable was off. Respect TraceEnable when constructing the DAV Allow field. PR: 70264 GitHub: closes #827 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1939146 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit 261058fa22ea08f94613dbe76fd401ba3f09ff54) --- changes-entries/dav-options-trace.txt | 2 ++ modules/dav/main/mod_dav.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changes-entries/dav-options-trace.txt diff --git a/changes-entries/dav-options-trace.txt b/changes-entries/dav-options-trace.txt new file mode 100644 index 00000000000..a7d10a354a0 --- /dev/null +++ b/changes-entries/dav-options-trace.txt @@ -0,0 +1,2 @@ + *) mod_dav: Do not list TRACE in the Allow field of an OPTIONS response when + TraceEnable is off. PR 70264 diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 6aa0cbe8861..b74f9da042c 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -1698,6 +1698,8 @@ static int dav_method_search(request_rec *r) /* handle the OPTIONS method */ static int dav_method_options(request_rec *r) { + core_server_config *conf = + ap_get_core_module_config(r->server->module_config); const dav_hooks_locks *locks_hooks = DAV_GET_HOOKS_LOCKS(r); const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(r); const dav_hooks_binding *binding_hooks = DAV_GET_HOOKS_BINDING(r); @@ -1829,7 +1831,9 @@ static int dav_method_options(request_rec *r) apr_table_addn(methods, "HEAD", ""); apr_table_addn(methods, "POST", ""); apr_table_addn(methods, "DELETE", ""); - apr_table_addn(methods, "TRACE", ""); + if (conf->trace_enable != AP_TRACE_DISABLE) { + apr_table_addn(methods, "TRACE", ""); + } apr_table_addn(methods, "PROPFIND", ""); apr_table_addn(methods, "PROPPATCH", ""); apr_table_addn(methods, "COPY", ""); From 223fd22a7edbb3d0d52dbc8dddd34c4868920fc0 Mon Sep 17 00:00:00 2001 From: Manfred Kaiser Date: Wed, 28 Oct 2026 16:37:47 +0100 Subject: [PATCH 5/9] mod_dav: Enforce the lock-owner check on the untagged If: fallback too (#889) dav_find_submitted_locktoken() scans the whole If: header for a usable locktoken without checking whether the lock belongs to the authenticated user. dav_validate_resource_state() repeats that owner check itself on the tagged-list path, but not here, so a non-matching If: tag (one whose URI does not apply to the resource) forces the untagged fallback and lets an authenticated writer use another user's locktoken. Factor the existing owner check out into dav_lock_owned_by_other_user() and call it from dav_find_submitted_locktoken() as well: a lock owned by another user is skipped during the scan instead of being treated as a usable match. The scan continues past the skip, so a header that legitimately carries the current user's own token - under any tag, or none - still succeeds. * modules/dav/main/util.c (dav_lock_owned_by_other_user): New. (dav_find_submitted_locktoken): Take request_rec and skip a lock owned by another user. Both call sites updated. (dav_validate_resource_state): Use the new helper; no behaviour change. (cherry picked from commit 9a9457ffdc7ef51e7bce15140132732aaa2ff124) --- modules/dav/main/util.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c index c82e88e74bc..a0c64f2bd92 100644 --- a/modules/dav/main/util.c +++ b/modules/dav/main/util.c @@ -893,7 +893,18 @@ static dav_error * dav_process_if_header(request_rec *r, dav_if_header **p_ih) return NULL; } -static int dav_find_submitted_locktoken(const dav_if_header *if_header, +/* +** If an authenticated user created a lock, only that user may submit its +** locktoken to manipulate a resource. +*/ +static int dav_lock_owned_by_other_user(const request_rec *r, + const dav_lock *lock) +{ + return lock->auth_user && (!r->user || strcmp(lock->auth_user, r->user)); +} + +static int dav_find_submitted_locktoken(const request_rec *r, + const dav_if_header *if_header, const dav_lock *lock_list, const dav_hooks_locks *locks_hooks) { @@ -924,6 +935,10 @@ static int dav_find_submitted_locktoken(const dav_if_header *if_header, */ for (lock = lock_list; lock != NULL; lock = lock->next) { + if (dav_lock_owned_by_other_user(r, lock)) { + continue; + } + if (!(*locks_hooks->compare_locktoken)(state_list->locktoken, lock->locktoken)) { return 1; } @@ -1313,9 +1328,7 @@ static dav_error * dav_validate_resource_state(apr_pool_t *p, ** the lock, only the same user may submit that locktoken ** to manipulate a resource. */ - if (lock->auth_user && - (!r->user || - strcmp(lock->auth_user, r->user))) { + if (dav_lock_owned_by_other_user(r, lock)) { const char *errmsg; errmsg = apr_pstrcat(p, "User \"", @@ -1433,7 +1446,7 @@ static dav_error * dav_validate_resource_state(apr_pool_t *p, ** Note that seen_locktoken == 0 implies lock_list != NULL ** which implies locks_hooks != NULL. */ - if (dav_find_submitted_locktoken(if_header, lock_list, + if (dav_find_submitted_locktoken(r, if_header, lock_list, locks_hooks)) { /* ** We found a match! We're set... none of the If: header @@ -1493,7 +1506,7 @@ static dav_error * dav_validate_resource_state(apr_pool_t *p, ** Note that seen_locktoken == 0 implies lock_list != NULL which implies ** locks_hooks != NULL. */ - if (dav_find_submitted_locktoken(if_header, lock_list, locks_hooks)) { + if (dav_find_submitted_locktoken(r, if_header, lock_list, locks_hooks)) { /* ** We found a match! We're set... we have a matching state list, ** and the If: header specified the locktoken somewhere. We're done. From 9f164369087d47e099d4c448277c0ee0b76fbff9 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 Nov 2026 17:31:05 +0000 Subject: [PATCH 6/9] mod_dav: Ignore negated lock tokens when checking for a submitted token: * modules/dav/main/util.c (dav_find_submitted_locktoken): Skip states with a "Not" condition. * test/modules/dav/test_006_if_not_locktoken.py: New test. * changes-entries/dav-if-not-locktoken.txt: New file. Co-Authored-By: Claude Fable 5.2 (cherry picked from commit d7ed293f17f5c3acc264e0d4f837e49c401420f3) --- changes-entries/dav-if-not-locktoken.txt | 2 + modules/dav/main/util.c | 4 +- test/modules/dav/test_006_if_not_locktoken.py | 98 +++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 changes-entries/dav-if-not-locktoken.txt create mode 100644 test/modules/dav/test_006_if_not_locktoken.py diff --git a/changes-entries/dav-if-not-locktoken.txt b/changes-entries/dav-if-not-locktoken.txt new file mode 100644 index 00000000000..3ef286ca3d2 --- /dev/null +++ b/changes-entries/dav-if-not-locktoken.txt @@ -0,0 +1,2 @@ + *) mod_dav: Do not accept a lock token given under "Not" in the If + header as submitting that token for a locked resource. [Joe Orton] diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c index a0c64f2bd92..a60a48d58e4 100644 --- a/modules/dav/main/util.c +++ b/modules/dav/main/util.c @@ -915,7 +915,9 @@ static int dav_find_submitted_locktoken(const request_rec *r, state_list != NULL; state_list = state_list->next) { - if (state_list->type == dav_if_opaquelock) { + /* A locktoken given under "Not" has not been submitted. */ + if (state_list->type == dav_if_opaquelock + && state_list->condition == DAV_IF_COND_NORMAL) { const dav_lock *lock; /* given state_list->locktoken, match it */ diff --git a/test/modules/dav/test_006_if_not_locktoken.py b/test/modules/dav/test_006_if_not_locktoken.py new file mode 100644 index 00000000000..d63d2c76a1a --- /dev/null +++ b/test/modules/dav/test_006_if_not_locktoken.py @@ -0,0 +1,98 @@ +import glob +import os + +import pytest + +from pyhttpd.conf import HttpdConf + + +LOCK_BODY = ('' + '' + '' + '' + 'test-owner' + '') + +BOGUS_TOKEN = '' + + +class TestDavIfNotLocktoken: + """A locktoken given under "Not" in the If: header is an assertion + that the token is not held, and must not count as submitting the + token for a locked resource.""" + + @pytest.fixture(autouse=True, scope='class') + @classmethod + def _class_scope(cls, env): + dav_dir = os.path.join(env.gen_dir, 'dav-ifnot') + os.makedirs(dav_dir, exist_ok=True) + for f in glob.glob(os.path.join(env.gen_dir, 'davlock-ifnot*')): + os.remove(f) + dav_dir_conf = dav_dir.replace('\\', '/') + lock_db_conf = os.path.join(env.gen_dir, + 'davlock-ifnot').replace('\\', '/') + conf = HttpdConf(env, extras={ + 'base': f""" + DavLockDB "{lock_db_conf}" + """, + f"test1.{env.http_tld}": f""" + Alias /dav-ifnot "{dav_dir_conf}" + + Dav On + Require all granted + + """, + }) + conf.add_vhost_test1() + conf.install() + assert env.apache_restart() == 0 + + def _url(self, env, name): + return env.mkurl("http", "test1", f"/dav-ifnot/{name}") + + def _locked(self, env, name): + """Create and lock a resource, returning its URL and the + locktoken in Coded-URL form.""" + with open(os.path.join(env.gen_dir, 'dav-ifnot', name), 'w') as fd: + fd.write('locked') + url = self._url(env, name) + r = env.curl_raw(url, options=[ + '-X', 'LOCK', + '-H', 'Content-Type: text/xml', + '--data-binary', LOCK_BODY]) + assert r.response["status"] == 200 + return url, r.response["header"]["lock-token"] + + def _put(self, env, url, if_header): + return env.curl_raw(url, options=[ + '-X', 'PUT', + '-H', f'If: {if_header}', + '--data-binary', 'changed']) + + # "Not " in a tagged list for another resource + def test_dav_006_01_not_token_other_resource(self, env): + url, token = self._locked(env, 'one.txt') + other = self._url(env, 'other.txt') + r = self._put(env, url, f'<{other}> (Not {token})') + assert r.response["status"] == 423 + env.httpd_error_log.ignore_recent(matches=[r'.*dav:error.*']) + + # As above, where a tagged list for the resource itself also matches + def test_dav_006_02_not_token_matching_list(self, env): + url, token = self._locked(env, 'two.txt') + other = self._url(env, 'other.txt') + r = self._put(env, url, + f'<{url}> (Not {BOGUS_TOKEN}) <{other}> (Not {token})') + assert r.response["status"] == 423 + env.httpd_error_log.ignore_recent(matches=[r'.*dav:error.*']) + + # The token is still accepted when submitted without "Not", + # whichever resource the list is tagged for. + @pytest.mark.parametrize("tag", ['three.txt', 'other.txt']) + def test_dav_006_03_token_submitted(self, env, tag): + url, token = self._locked(env, 'three.txt') + r = self._put(env, url, f'<{self._url(env, tag)}> ({token})') + assert r.response["status"] == 204 + r = env.curl_raw(url, options=['-X', 'UNLOCK', + '-H', f'Lock-Token: {token}']) + assert r.response["status"] == 204 From 9c914685180e4a3f8b9801514bc75224412f6e39 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 Nov 2026 17:31:05 +0000 Subject: [PATCH 7/9] mod_dav: XML-quote core property values taken from the subrequest: * modules/dav/main/props.c (dav_insert_coreprop): Quote the getcontenttype and getcontentlanguage values. * test/modules/dav/test_007_propfind_quoting.py: New test. * changes-entries/dav-propfind-quoting.txt: New file. Co-Authored-By: Claude Fable 5.2 (cherry picked from commit c58a6f27b0c0dcc8616ba7816df29658ca440b52) --- changes-entries/dav-propfind-quoting.txt | 2 + modules/dav/main/props.c | 5 +- test/modules/dav/test_007_propfind_quoting.py | 56 +++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 changes-entries/dav-propfind-quoting.txt create mode 100644 test/modules/dav/test_007_propfind_quoting.py diff --git a/changes-entries/dav-propfind-quoting.txt b/changes-entries/dav-propfind-quoting.txt new file mode 100644 index 00000000000..d2ad83f19ae --- /dev/null +++ b/changes-entries/dav-propfind-quoting.txt @@ -0,0 +1,2 @@ + *) mod_dav: Escape the getcontenttype and getcontentlanguage + properties in PROPFIND responses. [Joe Orton] diff --git a/modules/dav/main/props.c b/modules/dav/main/props.c index b5827505415..34ac544df37 100644 --- a/modules/dav/main/props.c +++ b/modules/dav/main/props.c @@ -399,7 +399,8 @@ static dav_error * dav_insert_coreprop(dav_propdb *propdb, dav_do_prop_subreq(propdb); } if (propdb->subreq->content_type != NULL) { - value = propdb->subreq->content_type; + value = apr_xml_quote_string(propdb->p, + propdb->subreq->content_type, 0); } break; @@ -412,7 +413,7 @@ static dav_error * dav_insert_coreprop(dav_propdb *propdb, } if ((lang = apr_table_get(propdb->subreq->headers_out, "Content-Language")) != NULL) { - value = lang; + value = apr_xml_quote_string(propdb->p, lang, 0); } break; } diff --git a/test/modules/dav/test_007_propfind_quoting.py b/test/modules/dav/test_007_propfind_quoting.py new file mode 100644 index 00000000000..52a5b5e2c81 --- /dev/null +++ b/test/modules/dav/test_007_propfind_quoting.py @@ -0,0 +1,56 @@ +import os +import xml.etree.ElementTree as ET + +import pytest + +from pyhttpd.conf import HttpdConf + + +CONTENT_TYPE = 'text/x-test; note="a&b"' + +PROPFIND_BODY = ('' + '' + '' + '') + + +class TestDavPropfindQuoting: + """DAV:getcontenttype must be XML-quoted in a PROPFIND response.""" + + @pytest.fixture(autouse=True, scope='class') + @classmethod + def _class_scope(cls, env): + dav_dir = os.path.join(env.gen_dir, 'dav-quote') + os.makedirs(dav_dir, exist_ok=True) + with open(os.path.join(dav_dir, 'hello.txt'), 'w') as fd: + fd.write('hello') + dav_dir_conf = dav_dir.replace('\\', '/') + conf = HttpdConf(env, extras={ + f"test1.{env.http_tld}": f""" + Alias /dav-quote "{dav_dir_conf}" + + Dav On + Require all granted + ForceType '{CONTENT_TYPE}' + + """, + }) + conf.add_vhost_test1() + conf.install() + assert env.apache_restart() == 0 + + @pytest.mark.parametrize("body", [PROPFIND_BODY, None]) + def test_dav_007_01_getcontenttype(self, env, body): + url = env.mkurl("http", "test1", "/dav-quote/hello.txt") + options = ['-X', 'PROPFIND', '-H', 'Depth: 0'] + if body: + options += ['-H', 'Content-Type: text/xml', + '--data-binary', body] + r = env.curl_raw(url, options=options) + assert r.response["status"] == 207 + # fails to parse if the property value is not quoted + root = ET.fromstring(r.response["body"]) + prop = root.find('.//{DAV:}getcontenttype') + assert prop is not None + assert prop.text == CONTENT_TYPE + assert len(prop) == 0 From c873c065a3813e5a4049444b9c6e11c2d5d49958 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 Nov 2026 19:45:00 +0000 Subject: [PATCH 8/9] * test/modules/dav/test_002_options_trace.py (TestOptionsTraceDisabled.test_dav_002_001): Mark as backported in 2.4.72. Co-Authored-By: Claude Fable 5.2 --- test/modules/dav/test_002_options_trace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/modules/dav/test_002_options_trace.py b/test/modules/dav/test_002_options_trace.py index 1d22133b08b..616fa49d6c9 100644 --- a/test/modules/dav/test_002_options_trace.py +++ b/test/modules/dav/test_002_options_trace.py @@ -48,7 +48,7 @@ def _class_scope(self, env): # TRACE is not offered while the server refuses it @pytest.mark.parametrize("path", ["/dav/file.txt", "/dav/col/"]) - @not_backported("r1939146", "DAV OPTIONS Allow honouring TraceEnable") + @not_backported("r1939146", "DAV OPTIONS Allow honouring TraceEnable", backported_in="2.4.72") def test_dav_002_001(self, env, path): status, allow = _request(env, "OPTIONS", path) assert status == 200 From a7c7cca3c6ae47e2bb831feb67af6a08097ac442 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 25 Nov 2026 20:32:19 +0000 Subject: [PATCH 9/9] * test/modules/dav/test_007_propfind_quoting.py (TestDavPropfindQuoting._class_scope): Set DavLockDB, which has no default in 2.4.x. Co-Authored-By: Claude Fable 5.2 --- test/modules/dav/test_007_propfind_quoting.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/modules/dav/test_007_propfind_quoting.py b/test/modules/dav/test_007_propfind_quoting.py index 52a5b5e2c81..aa05e7f9f6c 100644 --- a/test/modules/dav/test_007_propfind_quoting.py +++ b/test/modules/dav/test_007_propfind_quoting.py @@ -25,7 +25,12 @@ def _class_scope(cls, env): with open(os.path.join(dav_dir, 'hello.txt'), 'w') as fd: fd.write('hello') dav_dir_conf = dav_dir.replace('\\', '/') + lock_db_conf = os.path.join(env.gen_dir, + 'davlock-quote').replace('\\', '/') conf = HttpdConf(env, extras={ + 'base': f""" + DavLockDB "{lock_db_conf}" + """, f"test1.{env.http_tld}": f""" Alias /dav-quote "{dav_dir_conf}"