Repository navigation
Description
Describe the bug
The share jail can expose the same resource under several paths. The desktop client syncs the share jail via the Windows Cloud Files API (cfapi), which needs a 1:1 mapping between file id and path: every placeholder lives in exactly one place on disk. When the same file id shows up under two paths in the jail, the client has to fake unique ids (e.g. share id + resource id) and download the file twice.
There are two ways to end up with duplicates:
- nested shares: Alice shares
/foowith a group Brian is a member of (Viewer) and/foo/barwith Brian directly (Editor). Brian's share jail lists two mountpoints,fooandbar, sobaz.txtis reachable asfoo/bar/baz.txtandbar/baz.txtwith the sameoc:fileid. The jail root only dedupes shares of the same resource id, seeListContainerin the sharesstorageprovider. - shares from a space the user is a member of: if Alice shares a folder in a project space with Brian, and Brian is also a member of that space, the folder shows up in the space and in the share jail.
IMO the share jail should only expose subtrees the user cannot reach any other way:
- a share contained in another received share is merged into the outermost mountpoint
- shares from spaces the user is a member of are not listed in the jail
The graph sharedWithMe list is a different thing. Web uses it to show incoming shares and should keep listing every share.
There is a second problem when merging: the sharesstorageprovider checks permissions against the single share the path resolved to, e.g. in InitiateFileUpload:
if !receivedShare.GetShare().GetPermissions().GetPermissions().GetInitiateFileUpload() {
return &provider.InitiateFileUploadResponse{
Status: status.NewPermissionDenied(ctx, nil, "share does not grant InitiateFileDownload permission"),
}, nil
}So an upload to foo/bar/baz.txt is checked against the Viewer share on foo and denied, although Brian has Editor on bar. We should forward to the real storage provider and let it evaluate the effective grants on the node. The desktop client already picks up the per-resource permissions via oc:permissions.
Steps to reproduce
- Alice creates
/foo/bar/baz.txt - Alice shares
/foowith a group containing Brian, role Viewer - Alice shares
/foo/barwith Brian, role Editor - Brian sends a
PROPFINDwithDepth: 1to the share jail root/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668$a0ca6a90-a365-4782-871e-d44447bbc668
Expected behavior
- Brian's share jail only contains
foo - Brian can write
foo/bar/baz.txt - a share from a project space Brian is a member of does not show up in the share jail
GET /graph/v1beta1/me/drive/sharedWithMestill lists both shares
Actual behavior
- the share jail contains
fooandbar, andbaz.txthas the same file id under both paths - uploading to
foo/bar/baz.txtis denied - the project space share shows up in the share jail
Additional context
related: opencloud-eu/reva#1031 ... share roots in the jail should report the rename permission, because renaming a mountpoint is always allowed. When we merge bar into foo, bar is no longer a share root, so renaming it becomes a regular move inside foo and is governed by the permissions there.
related upstream: owncloud/ocis#8464 (lost permission with multiple shares on the same resource), owncloud/ocis#8232, owncloud/ocis#9933
AI assistance: Claude Code (claude-opus-5-5) helped trace the code and draft this issue.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsQualification
Activity
butonic commentedon Nov 18, 2026
cc @TheOneRing @micbar @dragotin @tbsbdr Opinions?
An acceptance test that documents the desired behavior is in #4056