From 94e86eb8dea57aa279b09d7e24f2bc282099f9cb Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Thu, 8 Feb 2024 12:01:55 +0100 Subject: [PATCH] fix an error when move using destination id --- changelog/unreleased/fix-move.md | 7 +++++++ go.mod | 2 +- go.sum | 4 ++-- .../reva/v2/internal/http/services/owncloud/ocdav/move.go | 6 +++++- vendor/modules.txt | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 changelog/unreleased/fix-move.md diff --git a/changelog/unreleased/fix-move.md b/changelog/unreleased/fix-move.md new file mode 100644 index 000000000..aabda3a1c --- /dev/null +++ b/changelog/unreleased/fix-move.md @@ -0,0 +1,7 @@ +Bugfix: Fix an error when move + +We fixed a bug that caused Internal Server Error when move using destination id + +https://github.com/owncloud/ocis/pull/8396 +https://github.com/cs3org/reva/pull/4503 +https://github.com/owncloud/ocis/issues/6739 diff --git a/go.mod b/go.mod index b0952cbaa..b743daa10 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/blevesearch/bleve/v2 v2.3.10 github.com/coreos/go-oidc/v3 v3.9.0 github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 - github.com/cs3org/reva/v2 v2.18.1-0.20240206135152-2343fe56d568 + github.com/cs3org/reva/v2 v2.18.1-0.20240208105019-d5e420d294be github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25 github.com/disintegration/imaging v1.6.2 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e diff --git a/go.sum b/go.sum index ce4c381a5..e49f1ed17 100644 --- a/go.sum +++ b/go.sum @@ -1019,8 +1019,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c= github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME= github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 h1:BUdwkIlf8IS2FasrrPg8gGPHQPOrQ18MS1Oew2tmGtY= github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva/v2 v2.18.1-0.20240206135152-2343fe56d568 h1:RDytVxpVjcJNLQM34yFvHkxnysVQJ0Sa4k4vuI1SH5o= -github.com/cs3org/reva/v2 v2.18.1-0.20240206135152-2343fe56d568/go.mod h1:GCN3g6uYE0Nvd31dGlhaGGyUviUfbG2NkecPRv5oSc4= +github.com/cs3org/reva/v2 v2.18.1-0.20240208105019-d5e420d294be h1:vljLn7q9NPfiynhzGBRD1sv8qhYGd6SZOHgvzv+Q9iA= +github.com/cs3org/reva/v2 v2.18.1-0.20240208105019-d5e420d294be/go.mod h1:GCN3g6uYE0Nvd31dGlhaGGyUviUfbG2NkecPRv5oSc4= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= diff --git a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/move.go b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/move.go index fbd51ee72..4706d20e9 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/move.go +++ b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/move.go @@ -266,7 +266,11 @@ func (s *svc) handleMove(ctx context.Context, w http.ResponseWriter, r *http.Req } // TODO what if intermediate is a file? } - + // resolve the destination path + if dst.Path == "." { + dst.Path = utils.MakeRelativePath(dstStatRes.GetInfo().GetName()) + dst.ResourceId = dstStatRes.GetInfo().GetParentId() + } mReq := &provider.MoveRequest{Source: src, Destination: dst} mRes, err := client.Move(ctx, mReq) if err != nil { diff --git a/vendor/modules.txt b/vendor/modules.txt index d3129c6cb..dd305259f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -362,7 +362,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.18.1-0.20240206135152-2343fe56d568 +# github.com/cs3org/reva/v2 v2.18.1-0.20240208105019-d5e420d294be ## explicit; go 1.21 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime