From ceddb7fe2d8d9a63a82268453b50dd8bcca70236 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 9 May 2023 15:39:10 +0200 Subject: [PATCH] Fix version restore after pp Co-authored-by: Julian Koberg Signed-off-by: Christian Richter --- changelog/unreleased/fix-version-restore-after-pp.md | 6 ++++++ pkg/storage/utils/decomposedfs/upload/upload.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/fix-version-restore-after-pp.md diff --git a/changelog/unreleased/fix-version-restore-after-pp.md b/changelog/unreleased/fix-version-restore-after-pp.md new file mode 100644 index 0000000000..5d7abaaabd --- /dev/null +++ b/changelog/unreleased/fix-version-restore-after-pp.md @@ -0,0 +1,6 @@ +Bugfix: Restore last version after positive result + +We fixed a bug in the copy routine that prevented restoring of a previous version after post-processing (e.g. virus scanning) + +https://github.com/cs3org/reva/pull/3867 +https://github.com/owncloud/enterprise/issues/5709 \ No newline at end of file diff --git a/pkg/storage/utils/decomposedfs/upload/upload.go b/pkg/storage/utils/decomposedfs/upload/upload.go index c06bc28f69..d65b3065c0 100644 --- a/pkg/storage/utils/decomposedfs/upload/upload.go +++ b/pkg/storage/utils/decomposedfs/upload/upload.go @@ -370,7 +370,7 @@ func (upload *Upload) cleanup(cleanNode, cleanBin, cleanInfo bool) { upload.Node = nil default: - if err := upload.lu.CopyMetadata(upload.Node.InternalPath(), p, func(attributeName string) bool { + if err := upload.lu.CopyMetadata(p, upload.Node.InternalPath(), func(attributeName string) bool { return strings.HasPrefix(attributeName, prefixes.ChecksumPrefix) || attributeName == prefixes.TypeAttr || attributeName == prefixes.BlobIDAttr ||