From ad2f10b371e83be6a43f97becc8f106ff992f095 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 30 Nov 2020 15:59:04 +0100 Subject: [PATCH] read owner information in ReadRecycleItem we have to read the owner information in ReadRecycleItem because the lookup would return the origin node path instead of the deleted node path Fixes https://github.com/owncloud/ocis/issues/551 --- changelog/unreleased/fix-ocis-storage-purge.md | 5 +++++ pkg/storage/fs/ocis/node.go | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 changelog/unreleased/fix-ocis-storage-purge.md diff --git a/changelog/unreleased/fix-ocis-storage-purge.md b/changelog/unreleased/fix-ocis-storage-purge.md new file mode 100644 index 0000000000..63de22af7f --- /dev/null +++ b/changelog/unreleased/fix-ocis-storage-purge.md @@ -0,0 +1,5 @@ +Bugfix: Fix purging deleted files with the ocis storage + +The ocis storage could load the owner information of a deleted file. This caused the storage to not be able to purge deleted files. + +https://github.com/owncloud/ocis/issues/551 diff --git a/pkg/storage/fs/ocis/node.go b/pkg/storage/fs/ocis/node.go index 2a6d32ed67..fe71edef96 100644 --- a/pkg/storage/fs/ocis/node.go +++ b/pkg/storage/fs/ocis/node.go @@ -124,6 +124,18 @@ func ReadRecycleItem(ctx context.Context, lu *Lookup, key string) (n *Node, tras } else { return } + // lookup ownerId in extended attributes + if attrBytes, err = xattr.Get(deletedNodePath, ownerIDAttr); err == nil { + n.ownerID = string(attrBytes) + } else { + return + } + // lookup ownerIdp in extended attributes + if attrBytes, err = xattr.Get(deletedNodePath, ownerIDPAttr); err == nil { + n.ownerIDP = string(attrBytes) + } else { + return + } // get origin node origin = "/"