s3: writing a file onto an existing folder's name creates a file that hides the folder (OCM grant PUT, possibly other surfaces) #976

Closed
opened 2026-10-19 21:35:40 +00:00 by Cordy · 1 comment
Owner

Found in the batch 4 review of Task A (2026-10-19). This predates batch 4.

What happens (s3): a PUT through an OCM grant to /dav/ocm/<pid>/sub, where sub is a folder that holds in.txt, answers 201. Afterwards:

  • the parent lists two sub entries;
  • listing sub answers "not a directory", so in.txt is hidden.

A PUT to the share root does the same. On posix the same PUT answers 500.

Related: #963 (s3 renames across file and folder names).

Expected:

  • The OCM grant PUT checks its target and answers 405 for a folder, as WebDAV does.
  • Every write surface (REST upload, WebDAV, TUS, OCM, public upload, WOPI) refuses to write a file over an existing folder, on both backends.
  • The s3 driver refuses it as well, as POSIX does.

To do: check which surfaces reach the s3 path. Test on posix and s3. Scheduled for batch 4 together with #963.

Found in the batch 4 review of Task A (2026-10-19). This predates batch 4. **What happens (s3):** a PUT through an OCM grant to `/dav/ocm/<pid>/sub`, where `sub` is a folder that holds `in.txt`, answers 201. Afterwards: - the parent lists two `sub` entries; - listing `sub` answers "not a directory", so `in.txt` is hidden. A PUT to the share root does the same. On posix the same PUT answers 500. **Related:** #963 (s3 renames across file and folder names). **Expected:** - The OCM grant PUT checks its target and answers 405 for a folder, as WebDAV does. - Every write surface (REST upload, WebDAV, TUS, OCM, public upload, WOPI) refuses to write a file over an existing folder, on both backends. - The s3 driver refuses it as well, as POSIX does. **To do:** check which surfaces reach the s3 path. Test on posix and s3. Scheduled for batch 4 together with #963.
Author
Owner

Shipped in v0.6.351 (PR #984), with #963. Both dogfoods run it.

Live (files-bao, Garage): a REST upload onto an existing folder's name answered 409 destination-exists, and the folder and its file stayed intact.

Covered by tests on posix and s3:

  • OCM grant PUT onto a folder: 405 (no OCM share is active on the dogfoods).
  • WebDAV PUT onto a collection: 405.
  • TUS and the public drop link: 409, with a reason on the page.
  • WOPI PutFile: 409, with code 1010.
**Shipped in v0.6.351 (PR #984), with #963. Both dogfoods run it.** **Live (files-bao, Garage):** a REST upload onto an existing folder's name answered 409 `destination-exists`, and the folder and its file stayed intact. **Covered by tests on posix and s3:** - OCM grant PUT onto a folder: 405 (no OCM share is active on the dogfoods). - WebDAV PUT onto a collection: 405. - TUS and the public drop link: 409, with a reason on the page. - WOPI PutFile: 409, with code 1010.
Cordy closed this issue 2026-10-20 13:58:14 +00:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#976
No description provided.