WebDAV quota properties report backend-wide usage instead of the person's #903

Closed
opened 2026-10-15 02:18:28 +00:00 by Cordy · 4 comments
Owner

Found during the #897 code research (2026-10-14). Not fixed in #897.

internal/dav/dav.go (~190-199): the RFC 4331 quota-used-bytes / quota-available-bytes properties report the whole backend's usage, not the person's home or space quota. Finder and Explorer show it as the drive's free space. For a device limited to one folder (#897) it is even less meaningful.

To do: research what Nextcloud/oCIS report per mount, decide per-root semantics (home quota, space quota, limited device's folder), test, docs.

Found during the #897 code research (2026-10-14). Not fixed in #897. `internal/dav/dav.go` (~190-199): the RFC 4331 `quota-used-bytes` / `quota-available-bytes` properties report the whole backend's usage, not the person's home or space quota. Finder and Explorer show it as the drive's free space. For a device limited to one folder (#897) it is even less meaningful. To do: research what Nextcloud/oCIS report per mount, decide per-root semantics (home quota, space quota, limited device's folder), test, docs.
Author
Owner

Research (2026-10-15)

Full file: cairn-work/scratch/b7e/batch907/903-research.md.

Today:

  • Quota sent with every PROPFIND: dav.go:322-332 adds quota to every collection PROPFIND, including allprop, against RFC 4331 §2. The figures are POSIX statfs of the whole filesystem, or the instance cap.
  • Likely S3 bug: S3 reports Free=0/Total=0 (#178), so with no instance cap WebDAV may say quota-available-bytes 0. macOS then sees a full volume; rclone #7543 shows the same pattern. Needs a confirming test. ARCHITECTURE.md:286 is outdated.
  • Disclosure gap (CWE-200): #890 made instance figures admin-only on REST, but WebDAV hands them to every person and app password.
  • 507 responses lack the RFC 4331 §6 XML body.

Clients (checked in their source unless marked):

  • Finder (webdavfs): asks only at the mount root, at most every 60 s; reads values unsigned; stops asking if used + available is 0 or overflows.
  • davfs2: root only, unsigned; Nextcloud's -3 became 16 EiB in df.
  • rclone about: asks at the root, ignores negatives.
  • gvfs and KIO: ask per folder.
  • Cyberduck: treats negative as unlimited.
  • Windows Explorer: said to show the local C: drive (KB 2386902); unverified, needs a live check.

Elsewhere:

  • Nextcloud: per mount; the owner's quota on received shares; -3 for unlimited. Users complain about negatives, 0 free and Windows showing C:.
  • oCIS: -2, and only when the properties are asked for by name.

Recommendation (per bucket):

  • used: the bucket's own bytes.
  • available: the smallest of the bucket cap minus used, the instance remainder and disk free, clamped at 0.
  • Nothing known (S3 without caps): omit both properties.
  • Paths:
    • / and /home: the person's home.
    • /spaces/<s>: that space.
    • synthetic /spaces, /shared and /shared/<owner>: nothing.
    • limited devices: their folder's bucket, via Resolve.
  • When: compute only when the properties are named, on the target only, with singleflight.
  • Also: drop the instance figures from WebDAV, add the 507 body, update the docs.

Decisions (my recommendation in brackets):

  1. Unlimited or unknown [omit, or disk/instance free when known].
  2. /shared grants [write grants: used=0, available = the owner's remaining room; read grants: nothing].
  3. Read-only space members [same figures as writers].
  4. Flat-mode root [used=0, instance/disk free].
  5. allprop [only when named].
  6. Depth-1 children [target only for now].

Mockup: none. Size: about 1-1.5 days, with live checks of Finder, rclone, davfs2, gio and Windows.

## Research (2026-10-15) Full file: `cairn-work/scratch/b7e/batch907/903-research.md`. **Today:** - **Quota sent with every PROPFIND:** `dav.go:322-332` adds quota to every collection PROPFIND, including allprop, against RFC 4331 §2. The figures are POSIX `statfs` of the whole filesystem, or the instance cap. - **Likely S3 bug:** S3 reports Free=0/Total=0 (#178), so with no instance cap WebDAV may say `quota-available-bytes 0`. macOS then sees a full volume; rclone #7543 shows the same pattern. Needs a confirming test. ARCHITECTURE.md:286 is outdated. - **Disclosure gap (CWE-200):** #890 made instance figures admin-only on REST, but WebDAV hands them to every person and app password. - **507 responses** lack the RFC 4331 §6 XML body. **Clients (checked in their source unless marked):** - **Finder (webdavfs):** asks only at the mount root, at most every 60 s; reads values unsigned; stops asking if used + available is 0 or overflows. - **davfs2:** root only, unsigned; Nextcloud's -3 became 16 EiB in `df`. - **rclone `about`:** asks at the root, ignores negatives. - **gvfs and KIO:** ask per folder. - **Cyberduck:** treats negative as unlimited. - **Windows Explorer:** said to show the local C: drive (KB 2386902); unverified, needs a live check. **Elsewhere:** - **Nextcloud:** per mount; the owner's quota on received shares; -3 for unlimited. Users complain about negatives, 0 free and Windows showing C:. - **oCIS:** -2, and only when the properties are asked for by name. **Recommendation (per bucket):** - **used:** the bucket's own bytes. - **available:** the smallest of the bucket cap minus used, the instance remainder and disk free, clamped at 0. - **Nothing known** (S3 without caps): omit both properties. - **Paths:** - `/` and `/home`: the person's home. - `/spaces/<s>`: that space. - synthetic `/spaces`, `/shared` and `/shared/<owner>`: nothing. - limited devices: their folder's bucket, via `Resolve`. - **When:** compute only when the properties are named, on the target only, with singleflight. - **Also:** drop the instance figures from WebDAV, add the 507 body, update the docs. **Decisions** (my recommendation in brackets): 1. Unlimited or unknown [omit, or disk/instance free when known]. 2. `/shared` grants [write grants: used=0, available = the owner's remaining room; read grants: nothing]. 3. Read-only space members [same figures as writers]. 4. Flat-mode root [used=0, instance/disk free]. 5. allprop [only when named]. 6. Depth-1 children [target only for now]. Mockup: none. Size: about 1-1.5 days, with live checks of Finder, rclone, davfs2, gio and Windows.
Author
Owner

Decisions (Nikola, 2026-10-15): all recommendations accepted (comment 9159): per-bucket figures, omit when unknown, write grants used=0 + owner's remaining room, read grants nothing, read-only members same as writers, flat root used=0 + free, only when named, target only. Built in batch A.

**Decisions (Nikola, 2026-10-15): all recommendations accepted** (comment 9159): per-bucket figures, omit when unknown, write grants used=0 + owner's remaining room, read grants nothing, read-only members same as writers, flat root used=0 + free, only when named, target only. Built in batch A.
Author
Owner

Shipped in v0.6.343 (PR #910). Both dogfoods run v0.6.344.

  • WebDAV quota figures are per bucket: home, space, or write grant (used 0, with the owner's remaining room). A read grant gets no figures.
  • Figures are sent only when the properties are named in the request, and never when no limit is known. That removes the S3 "0 free" figure.
  • A quota 507 carries the RFC 4331 §6 body and X-Cairn-Code.
  • A backend ENOSPC now answers 507.

Live check (local instance), PASS:

  • The figures are correct for a person, a read-only member, an admin and a folder-limited device.
  • No figures without named properties, or with allprop.
  • A PUT over the quota gets 507 with the RFC 4331 body.

Still open: Finder, rclone and Windows on the dogfoods. rclone needs a separate remote per space, as the docs now say. Doing these with Nikola, then closing.

## Shipped in v0.6.343 (PR #910). Both dogfoods run v0.6.344. - WebDAV quota figures are per bucket: home, space, or write grant (used 0, with the owner's remaining room). A read grant gets no figures. - Figures are sent only when the properties are named in the request, and never when no limit is known. That removes the S3 "0 free" figure. - A quota 507 carries the RFC 4331 §6 body and `X-Cairn-Code`. - A backend ENOSPC now answers 507. **Live check (local instance), PASS:** - The figures are correct for a person, a read-only member, an admin and a folder-limited device. - No figures without named properties, or with allprop. - A PUT over the quota gets 507 with the RFC 4331 body. **Still open:** Finder, rclone and Windows on the dogfoods. rclone needs a separate remote per space, as the docs now say. Doing these with Nikola, then closing.
Author
Owner

Closing as fixed (v0.6.343): WebDAV quota properties report the person's usage (internal/dav/dav.go:232,338 on v0.6.358 main). The Finder, rclone and Windows checks stay tracked in #914 and #1005 section F.

Closing as fixed (v0.6.343): WebDAV quota properties report the person's usage (`internal/dav/dav.go:232,338` on v0.6.358 main). The Finder, rclone and Windows checks stay tracked in #914 and #1005 section F.
Cordy closed this issue 2026-10-26 23:43:08 +00:00
Sign in to join this conversation.
No labels
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#903
No description provided.