Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring a file from the trashbin that was deleted from a previously deleted subfolder causes unexpected behaviour #2041

Open
jngrb opened this issue Jul 20, 2022 · 1 comment
Labels
1. to develop Issues that are ready for development bug feature: trashbin Items related to the trashbin feature

Comments

@jngrb
Copy link
Contributor

jngrb commented Jul 20, 2022

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Create a group folder /groupfolder (can have ACL or not)
  2. Create a sub folder /groupfolder/sub
  3. Create a file /groupfolder/sub/to-be-deleted in the sub folder
  4. Delete the file /groupfolder/sub/to-be-deleted
  5. Delete the folder /groupfolder/sub
  6. Restore the file to-be-deleted from the trashbin

Expected behaviour

Restoration either fails because the folder to which the restoration should happen no longer exists.
Or restoration re-creates the deleted folder and puts the deleted file in it (but only if the restoring user has the necessary permissions.)

Actual behaviour

The file to-be-deleted is restored in the root groupfolder, i.e. as /groupfolder/to-be-deleted

Extended test 1

  • Create a file /groupfolder/already/existing/folders/sub/to-be-deleted (assuming that the parent folders exists)
  • Delete the file /groupfolder/already/existing/folders/sub/to-be-deleted
  • Delete the folder /groupfolder/already/existing/folders/sub
  • Restore the file to-be-deleted from the trashbin
    => The file is still restored in the root folder, i.e. as /groupfolder/to-be-deleted

Extended test 2

  • Admin creates a groupfolder with subfolders /groupfolder/already/existing/folders and activates ACL on the groupfolder
  • Admin denies write access to the root folder to user A, but gives user A read&write access to the subfolder /groupfolder/already/existing/folders
  • User A create a folder /groupfolder/already/existing/folders/sub
  • User A creates a file /groupfolder/already/existing/folders/sub/to-be-deleted
  • User A deletes the file /groupfolder/already/existing/folders/sub/to-be-deleted
  • User A deletes the folder /groupfolder/already/existing/folders/sub
  • User A restores the file to-be-deleted from the trashbin
    => The file is still restored in the root folder, i.e. as /groupfolder/to-be-deleted despite the fact that user A does not have write access to the root groupfolder

Server configuration

Operating system: Official nextcloud (FPM) container in OKD/Openshift

Web server: Nginx reverse proxy as "side-container" behind OKD/Openshift-Router

Database: Postgresql

PHP version: PHP 8.0.20

Nextcloud version: NC 24.0.2

Group folders version: 12.0.1

Updated from an older Nextcloud/ownCloud or fresh install: upgraded for several versions now

Client configuration

Browser: Firefox (does not matter)

Operating system: Ubuntu (does not matter)

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
<no nextcloud log entries are produced by the actions above>

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@jngrb jngrb added 0. Needs triage Issues that need to be triaged bug labels Jul 20, 2022
@fschrempf fschrempf added 1. to develop Issues that are ready for development feature: trashbin Items related to the trashbin feature and removed 0. Needs triage Issues that need to be triaged labels Jul 29, 2022
@joshtrichards
Copy link
Member

Related: #2644

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Issues that are ready for development bug feature: trashbin Items related to the trashbin feature
Projects
None yet
Development

No branches or pull requests

3 participants