From d18452f081618ab87cd45decbf099279d8d79def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 25 May 2021 15:07:24 +0000 Subject: [PATCH] 'fix' paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .../owncloud/ocs/handlers/apps/sharing/shares/pending.go | 4 ++-- .../owncloud/ocs/handlers/apps/sharing/shares/shares.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending.go index f88d715a64b..b323a033d5c 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/pending.go @@ -111,8 +111,8 @@ func (h *Handler) updateReceivedShare(w http.ResponseWriter, r *http.Request, sh // But if a request DOES use an id, the Ref contains the same id? at least in the Ref part of the ResouceInfo // In the Id of a Resoucre info the storageid and node id are always set. // so ... if info.Ref.StorageId != "" -> use /dav/spaces path, otherwise use path and append it to webdav endpoint - data.FileTarget = path.Join(h.sharePrefix, info.Ref.Path) - data.Path = path.Join(h.sharePrefix, info.Ref.Path) + data.FileTarget = path.Join(h.sharePrefix, path.Base(info.Ref.Path)) // FIXME @butonic REFERENCES use same "wrong" path!!!! + data.Path = path.Join(h.sharePrefix, path.Base(info.Ref.Path)) } response.WriteOCSSuccess(w, r, data) diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go index d7442603ddf..cfa53438942 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go @@ -647,8 +647,8 @@ func (h *Handler) listSharesWithMe(w http.ResponseWriter, r *http.Request) { if data.State == ocsStateAccepted { // Needed because received shares can be jailed in a folder in the users home - data.FileTarget = path.Join(h.sharePrefix, info.Ref.Path) - data.Path = path.Join(h.sharePrefix, info.Ref.Path) + data.FileTarget = path.Join(h.sharePrefix, path.Base(info.Ref.Path)) + data.Path = path.Join(h.sharePrefix, path.Base(info.Ref.Path)) } shares = append(shares, data)