From 62fb38ea221431a129c9126383b3736260df52e4 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 29 Jun 2020 14:26:24 +0200 Subject: [PATCH] Fix public stat and listcontainer response to contain the correct prefix Fixes COPY operations on public links --- .../services/publicstorageprovider/publicstorageprovider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/grpc/services/publicstorageprovider/publicstorageprovider.go b/internal/grpc/services/publicstorageprovider/publicstorageprovider.go index 5e0bbf5165..afec9427c3 100644 --- a/internal/grpc/services/publicstorageprovider/publicstorageprovider.go +++ b/internal/grpc/services/publicstorageprovider/publicstorageprovider.go @@ -390,7 +390,7 @@ func (s *service) Stat(ctx context.Context, req *provider.StatRequest) (*provide // prevent leaking internal paths if statResponse.Info != nil { - statResponse.Info.Path = path.Join("/", tkn, relativePath) + statResponse.Info.Path = path.Join(s.mountPath, "/", tkn, relativePath) } return statResponse, nil @@ -428,7 +428,7 @@ func (s *service) ListContainer(ctx context.Context, req *provider.ListContainer } for i := range listContainerR.Infos { - listContainerR.Infos[i].Path = path.Join("/", tkn, relativePath, path.Base(listContainerR.Infos[i].Path)) + listContainerR.Infos[i].Path = path.Join(s.mountPath, "/", tkn, relativePath, path.Base(listContainerR.Infos[i].Path)) } return listContainerR, nil