Skip to content

Commit

Permalink
fix share jail mountpoint parent id
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Oct 2, 2024
1 parent 2c0d774 commit f779bd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-sharejail-mountpoint-parentid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fix share jail mountpoint parent id

Stating a share jail mountpoint now returns the share jail root as the parent id.

https://github.com/cs3org/reva/pull/4876
https://github.com/owncloud/ocis/issues/9933
Original file line number Diff line number Diff line change
Expand Up @@ -798,14 +798,20 @@ func (s *service) Stat(ctx context.Context, req *provider.StatRequest) (*provide
return nil, err
}

// when stating a share jail mountpoint we need to rewrite the id and use the share
// jail space id as the mountpoint has a different id than the grant
// when stating a share jail mountpoint we need to rewrite the ids
if statRes.GetStatus().GetCode() == rpc.Code_CODE_OK && receivedShare.MountPoint.Path == strings.TrimPrefix(req.Ref.Path, "./") && statRes.Info != nil {
// overwrite id with the share jail mountpoint id
statRes.Info.Id = &provider.ResourceId{
StorageId: utils.ShareStorageProviderID,
SpaceId: utils.ShareStorageSpaceID,
OpaqueId: receivedShare.GetShare().GetId().GetOpaqueId(),
}
// overwrite parent id with the share jail root
statRes.Info.ParentId = &provider.ResourceId{
StorageId: utils.ShareStorageProviderID,
SpaceId: utils.ShareStorageSpaceID,
OpaqueId: utils.ShareStorageSpaceID,
}
}

return statRes, nil
Expand Down

0 comments on commit f779bd6

Please sign in to comment.