Skip to content

Commit

Permalink
Fix grant space ID
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed May 12, 2022
1 parent 302c2cd commit 1fe7f2d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/share-jail-fixes.md
Original file line number Diff line number Diff line change
@@ -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
15 changes: 12 additions & 3 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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
Expand Down

0 comments on commit 1fe7f2d

Please sign in to comment.