Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix share jail mountpoint parent id #4876

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading