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

[bug]: Anonymous users cannot delete files in a publicly shared groupfolder #3544

Open
kyteinsky opened this issue Jan 17, 2025 · 3 comments
Labels
0. Needs triage Issues that need to be triaged bug feature: files Files integration feature: trashbin Items related to the trashbin feature

Comments

@kyteinsky
Copy link

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 groupfolder and add some files to it
  2. Create a public share of the whole groupfolder with delete permission
  3. Open the share in incognito and try to delete a file

Expected behaviour

The file is deleted successfully.

Actual behaviour

Error is shown on the page: Error deleting file "hoho world.md".

Server configuration

Operating system: Debian 12

Web server: apache 2.4.62-1~deb12u2

Database: sqlite

PHP version: 8.1.30

Nextcloud version: (see Nextcloud admin page) v29.0.11

Team folders version: 17.0.8

Updated from an older Nextcloud/ownCloud or fresh install: no

Where did you install Nextcloud from: Julius' docker dev

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Browser: Chromium v128

Operating system: Debian testing

Logs

Web server error log

Web server error log
proxy-1  | nginx.1     | stable29.local 192.168.21.1 - - [17/Jan/2025:14:59:02 +0000] "DELETE /public.php/dav/files/tiDjCZdH7MBNJan/hoho%20world.md HTTP/1.1" 500 2523 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" "192.168.21.7:80"

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"fZFn4MVsncLnG2n6XIfD","level":3,"time":"2025-01-17T14:59:02+00:00","remoteAddr":"192.168.21.3","user":"--","app":"webdav","method":"DELETE","url":"/public.php/dav/files/tiDjCZdH7MBNJan/hoho%20world.md","message":"file moved to trash with no user in context","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","version":"29.0.11.1","exception":{"Exception":"Exception","Message":"file moved to trash with no user in context","Code":0,"Trace":[{"file":"/var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php","line":102,"function":"moveToTrash","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->","args":[{"__class__":"OCA\\Files_Trashbin\\Storage","cache":null,"scanner":null,"watcher":null,"propagator":null,"updater":null},"hoho world.md"]},{"file":"/var/www/html/apps/files_trashbin/lib/Storage.php","line":190,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->","args":[{"__class__":"OCA\\Files_Trashbin\\Storage","cache":null,"scanner":null,"watcher":null,"propagator":null,"updater":null},"hoho world.md"]},{"file":"/var/www/html/apps/files_trashbin/lib/Storage.php","line":89,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->","args":["hoho world.md","unlink"]},{"file":"/var/www/html/lib/private/Files/View.php","line":1171,"function":"unlink","class":"OCA\\Files_Trashbin\\Storage","type":"->","args":["hoho world.md"]},{"file":"/var/www/html/lib/private/Files/View.php","line":705,"function":"basicOperation","class":"OC\\Files\\View","type":"->","args":["unlink","hoho world.md",["delete"]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/File.php","line":543,"function":"unlink","class":"OC\\Files\\View","type":"->","args":["hoho world.md"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":197,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\File","type":"->","args":[]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":281,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->","args":["hoho world.md"]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":472,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["method:DELETE",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":61,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/apps/dav/appinfo/v2/publicremote.php","line":159,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/public.php","line":107,"args":["/var/www/html/apps/dav/appinfo/v2/publicremote.php"],"function":"require_once"}],"File":"/var/www/html/apps-writable/groupfolders/lib/Trash/TrashBackend.php","Line":265,"message":"file moved to trash with no user in context","exception":{},"CustomMessage":"file moved to trash with no user in context"}}

Browser log

Browser log

Same as the server log.

@kyteinsky kyteinsky added 0. Needs triage Issues that need to be triaged bug feature: files Files integration feature: trashbin Items related to the trashbin feature labels Jan 17, 2025
@provokateurin
Copy link
Member

@kyteinsky this sounds like a duplicate of #3496 which has a fix available you should try: #3543

@kyteinsky
Copy link
Author

thanks, didn't realise it was the same with the title :)

@kyteinsky
Copy link
Author

ah no, it's slightly different in this case, it occurs at this line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Issues that need to be triaged bug feature: files Files integration feature: trashbin Items related to the trashbin feature
Projects
None yet
Development

No branches or pull requests

2 participants