[PR #417] [CLOSED] fix: Prevent recursive creation of parent directories #604

Closed
opened 2026-04-08 16:53:37 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/sigoden/dufs/pull/417
Author: @ign0tus
Created: 7/16/2024
Status: Closed

Base: mainHead: main


📝 Commits (1)

  • 4f0dc45 fix: Prevent recursive creation of parent directories

📊 Changes

3 files changed (+20 additions, -26 deletions)

View changed files

📝 src/server.rs (+17 -23)
📝 tests/allow.rs (+1 -1)
📝 tests/http.rs (+2 -2)

📄 Description

The specification of WebDAV (RFC4818) does not allow recursive creation of parent directories.

During MKCOL processing, a server MUST make the Request-URI an
internal member of its parent collection, unless the Request-URI is
"/". If no such ancestor exists, the method MUST fail. When the
MKCOL operation creates a new collection resource, all ancestors MUST
already exist, or the method MUST fail with a 409 (Conflict) status
code. For example, if a request to create collection /a/b/c/d/ is
made, and /a/b/c/ does not exist, the request must fail.1

The feature to create all parent recursively when uploading, moving or copying a file has been removed and instead a check has been introduced to see if the directory exists. If not, 409 CONFLICT is returned in accordance with RFC4818.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/sigoden/dufs/pull/417 **Author:** [@ign0tus](https://github.com/ign0tus) **Created:** 7/16/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`4f0dc45`](https://github.com/sigoden/dufs/commit/4f0dc453467882f300ef0f1f4dca36bf3772e775) fix: Prevent recursive creation of parent directories ### 📊 Changes **3 files changed** (+20 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/server.rs` (+17 -23) 📝 `tests/allow.rs` (+1 -1) 📝 `tests/http.rs` (+2 -2) </details> ### 📄 Description The specification of WebDAV (RFC4818) does not allow recursive creation of parent directories. > During MKCOL processing, a server MUST make the Request-URI an > internal member of its parent collection, unless the Request-URI is > "/". If no such ancestor exists, the method MUST fail. When the > MKCOL operation creates a new collection resource, all ancestors MUST > already exist, or the method MUST fail with a 409 (Conflict) status > code. For example, if a request to create collection /a/b/c/d/ is > made, and /a/b/c/ does not exist, the request must fail.[^1] The feature to create all parent recursively when uploading, moving or copying a file has been removed and instead a check has been introduced to see if the directory exists. If not, 409 CONFLICT is returned in accordance with RFC4818. [^1]: https://datatracker.ietf.org/doc/html/rfc4918#section-9.3 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-04-08 16:53:37 +03:00
zhus closed this issue 2026-04-08 16:53:37 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#604