diff --git a/changelog/unreleased/share-jail-fixes.md b/changelog/unreleased/share-jail-fixes.md new file mode 100644 index 00000000000..07047324cd9 --- /dev/null +++ b/changelog/unreleased/share-jail-fixes.md @@ -0,0 +1,5 @@ +Bugfix: Fix Grant Space IDs and webDAV GET Headers + +The opaqueID for a grant space was incorrectly overwritten with the root space id. We fixed that and now use the Filename from the fileinfo in GET WebDAV requests instead of using the value from the url. + +https://github.com/cs3org/reva/pull/2864 diff --git a/pkg/storage/utils/decomposedfs/spaces.go b/pkg/storage/utils/decomposedfs/spaces.go index 51d0de47b06..d677762118b 100644 --- a/pkg/storage/utils/decomposedfs/spaces.go +++ b/pkg/storage/utils/decomposedfs/spaces.go @@ -627,7 +627,16 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node, if err != nil { return nil, err } - + ssID, err := storagespace.FormatReference( + &provider.Reference{ + ResourceId: &provider.ResourceId{ + StorageId: n.SpaceRoot.SpaceID, + OpaqueId: n.ID}, + }, + ) + if err != nil { + return nil, err + } space := &provider.StorageSpace{ Opaque: &types.Opaque{ Map: map[string]*types.OpaqueEntry{ @@ -637,10 +646,10 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node, }, }, }, - Id: &provider.StorageSpaceId{OpaqueId: n.SpaceRoot.SpaceID}, + Id: &provider.StorageSpaceId{OpaqueId: ssID}, Root: &provider.ResourceId{ StorageId: n.SpaceRoot.SpaceID, - OpaqueId: n.SpaceRoot.ID, + OpaqueId: n.ID, }, Name: sname, // SpaceType is read from xattr below