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

WebDAV protocol XML parser doesn't handle XML namespaces correctly #5700

Closed
akselaase opened this issue Jul 5, 2022 · 0 comments
Closed
Assignees
Milestone

Comments

@akselaase
Copy link
Contributor

Motivation

The XML response parser in the WebDAV implementation does not properly handle resolution of different XML namespaces.

RFC 4918 specifies that the response to a PROPFIND request will use tags in the DAV: XML namespace, which is usually shortened to just D: by setting xmlns:D="DAV:" on the D:multistatus tag. The XML parsing in webdav.py depends on this D: alias, which causes it to mishandle responses from for instance the Apache DAV module which often uses lp1: instead by setting xmlns:lp1="DAV:".

Issue occurred when working on #5308 due to trying to test with an Apache WebDAV server.

Modification

Use Python's xml.etree.elementtree to properly resolve namespaces and traverse the DAV response, instead of comparing raw string values.

@akselaase akselaase self-assigned this Jul 5, 2022
akselaase added a commit to akselaase/rucio that referenced this issue Jul 6, 2022
…cio#5700, fix rucio#5308

As described in rucio#5700, the parser for the WebDAV server responses had
issues with namespace handling. This caused Rucio to misinterpret
responses from for instance the Apache DAV module. Changing the
implementation to use Python's xml.etree.ElementTree fixes this issue.

This PR also includes a fix for rucio#5308, in which Rucio doesn't properly
handle DAV servers with path prefixes.
akselaase added a commit to akselaase/rucio that referenced this issue Jul 12, 2022
@bari12 bari12 closed this as completed in 22a5662 Jul 29, 2022
@bari12 bari12 added this to the 1.30.0 "The Donkeynator" milestone Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants