Skip to content

mod_dav: Fix If header "Not" lock token handling and PROPFIND property quoting - #1086

Merged
notroj merged 2 commits into
apache:trunkfrom
notroj:dav-fixes
Nov 25, 2026
Merged

notroj merged 2 commits into
apache:trunkfrom
notroj:dav-fixes

Conversation

@notroj

@notroj notroj commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

Two independent mod_dav fixes, one per commit.

A lock token given under Not in the If header was counted as submitting that token when the header was rescanned for a locked resource, so a request such as If: <other-uri> (Not <token>) was allowed to modify the locked resource. dav_find_submitted_locktoken() now only counts tokens given without Not, and such requests get a 423.

The DAV:getcontenttype and DAV:getcontentlanguage values in a PROPFIND response were copied from the subrequest without XML quoting, so a value containing & or < (e.g. a ForceType with such a parameter) produced a malformed response. DAV:lockdiscovery and DAV:supportedlock are XML fragments and are left alone.

There is no test for DAV:getcontentlanguage, only DAV:getcontenttype.

🤖 Generated with Claude Code

notroj and others added 2 commits November 25, 2026 17:31
* 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 <noreply@anthropic.com>
* 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 <noreply@anthropic.com>
@notroj
notroj merged commit c58a6f2 into apache:trunk Nov 25, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant