Skip to content

Commit

Permalink
read owner information in ReadRecycleItem
Browse files Browse the repository at this point in the history
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 owncloud/ocis#551
  • Loading branch information
David Christofas committed Nov 30, 2020
1 parent da040e1 commit ad2f10b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-ocis-storage-purge.md
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions pkg/storage/fs/ocis/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "/"
Expand Down

0 comments on commit ad2f10b

Please sign in to comment.