From bbcbf692832245455a8e549e0783567178d13aae Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 19 Oct 2022 16:59:26 +0200 Subject: [PATCH] fix shareroot path in REPORT responses --- changelog/unreleased/received-share-path.md | 6 ++++++ services/search/pkg/search/provider/searchprovider.go | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/received-share-path.md diff --git a/changelog/unreleased/received-share-path.md b/changelog/unreleased/received-share-path.md new file mode 100644 index 000000000..9958a34cf --- /dev/null +++ b/changelog/unreleased/received-share-path.md @@ -0,0 +1,6 @@ +Bugfix: Fix the shareroot path in REPORT responses + +Fixed the shareroot path in REPORT responses. Before this change the attribute leaked part of the folder tree of the sharer. + +https://github.com/owncloud/ocis/pull/4859 +https://github.com/owncloud/ocis/issues/4796 diff --git a/services/search/pkg/search/provider/searchprovider.go b/services/search/pkg/search/provider/searchprovider.go index 1bfe01286..5201daf98 100644 --- a/services/search/pkg/search/provider/searchprovider.go +++ b/services/search/pkg/search/provider/searchprovider.go @@ -202,7 +202,8 @@ func (p *Provider) Search(ctx context.Context, req *searchsvc.SearchRequest) (*s SpaceId: spid, OpaqueId: oid, } - rootName = space.GetRootInfo().GetPath() + + rootName = filepath.Join("/", filepath.Base(gpRes.GetPath())) permissions = space.GetRootInfo().GetPermissionSet() p.logger.Debug().Interface("grantSpace", space).Interface("mountpointRootId", mountpointRootID).Msg("searching a grant") case "personal":