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

[stable29] fix(trash): Fix deleting items from public share with write access #3628

Closed
wants to merge 1 commit into from

Conversation

provokateurin
Copy link
Member

Manual backport of #3604

In 29 we don't have the deleted_by column we add, so I only had to remove the check for the user.

When no user in session, use an empty string as deleted_by, which shows
 as "Unknown" in the UI.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@provokateurin provokateurin added bug 3. to review Items that need to be reviewed labels Feb 18, 2025
@kyteinsky
Copy link

the deletion succeeds but there is some issue with viewing the deleted files in the owner's view.
the deleted file is correctly present in data/__groupfolders/trash/1

this seems like it would require some work to backport. It is fine if we skip it.

{"reqId":"vwgb3nUllB7OX5rmBcbx","level":3,"time":"2025-02-18T11:03:20+00:00","remoteAddr":"192.168.21.7","user":"admin","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/trashbin/admin/trash/","message":"/admin/files_trashbin/groupfolders/1","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.12.2","exception":{"Exception":"OCP\\Files\\NotFoundException","Message":"/admin/files_trashbin/groupfolders/1","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Node/LazyFolder.php","line":161,"function":"get","class":"OC\\Files\\Node\\Root","type":"->","args":["/admin/files_trashbin/groupfolders/1"]},{"file":"/var/www/html/apps-extra/groupfolders/lib/Trash/TrashBackend.php","line":432,"function":"get","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["/admin/files_trashbin/groupfolders/1"]},{"file":"/var/www/html/apps-extra/groupfolders/lib/Trash/TrashBackend.php","line":89,"function":"getTrashForFolders","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->","args":[{"__class__":"OC\\User\\User"},[{"folder_id":1,"mount_point":"gf","permissions":31,"quota":-3,"acl":false,"0":"And 1 more entries, set log level to debug to see all entries"}]]},{"file":"/var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php","line":47,"function":"listTrashRoot","class":"OCA\\GroupFolders\\Trash\\TrashBackend","type":"->","args":[{"__class__":"OC\\User\\User"}]},{"function":"OCA\\Files_Trashbin\\Trash\\{closure}","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/files_trashbin/lib/Trash/TrashManager.php","line":48,"function":"array_reduce","args":[{"OCP\\Files\\Storage\\IStorage":{"__class__":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend"},"OCA\\GroupFolders\\Mount\\GroupFolderStorage":"*** sensitive parameters replaced ***"},{"__class__":"Closure"},"*** sensitive parameters replaced ***"]},{"file":"/var/www/html/apps/files_trashbin/lib/Sabre/TrashRoot.php","line":75,"function":"listTrashRoot","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->","args":[{"__class__":"OC\\User\\User"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Tree.php","line":218,"function":"getChildren","class":"OCA\\Files_Trashbin\\Sabre\\TrashRoot","type":"->","args":[]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":900,"function":"getChildren","class":"Sabre\\DAV\\Tree","type":"->","args":["trashbin/admin/trash"]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":982,"function":"generatePathNodes","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\Files_Trashbin\\Sabre\\TrashRoot"}]]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1662,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["trashbin/admin/trash",["{http://nextcloud.org/ns}trashbin-deletion-time","{http://nextcloud.org/ns}trashbin-original-location","{http://nextcloud.org/ns}trashbin-title","{DAV:}getcontentlength","{DAV:}getcontenttype","And 21 more entries, set log level to debug to see all entries"],1]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":1647,"function":"writeMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\Xml\\Writer","elementMap":"*** sensitive parameters replaced ***","contextUri":"/remote.php/dav/","namespaceMap":{"DAV:":"d","http://sabredav.org/ns":"s","http://owncloud.org/ns":"oc","http://nextcloud.org/ns":"nc"},"classMap":"*** sensitive parameters replaced ***"},{"__class__":"Generator"},false]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":346,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Generator"},false]},{"file":"/var/www/html/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpPropFind","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:PROPFIND",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/var/www/html/apps/dav/lib/Connector/Sabre/Server.php","line":67,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/var/www/html/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"OCA\\DAV\\Connector\\Sabre\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/lib/Server.php","line":396,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/var/www/html/remote.php","line":172,"args":["/var/www/html/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/html/lib/private/Files/Node/Root.php","Line":212,"message":"/admin/files_trashbin/groupfolders/1","exception":{},"CustomMessage":"/admin/files_trashbin/groupfolders/1"}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Items that need to be reviewed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants