Bug 446537 - Permissions issue with trash files
Summary: Permissions issue with trash files
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Trash (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-06 00:33 UTC by Thiago Sueto
Modified: 2025-07-13 18:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Sueto 2021-12-06 00:33:30 UTC
SUMMARY
I've been encountering this bug for a long time already I think.

This seems to only occur with folders containing git repositories where I have built stuff.

Pressing Empty Trash results in "Could not delete file /home/blumen/.local/share/Trash/files/gitstuff/Kooha/_build/target/.rustc_info.json.", for instance. If I try to manually delete individual files inside such folders, same sort of message.
Using the Delete key shows the same message.

If I open the embedded Dolphin terminal, pwd reveals a different path, /run/user/1000/kio-fuse-VNSXQP/trash, which seems to originate from kio-fuse?

If I then do rm -rf 0-gitstuff, I get operation not permitted for every file.

If I do the same thing with sudo, I simply get operation not permitted for the entire folder. But those files are owned by my user and by the group users!

If I cd to /home/blumen/.local/share/Trash/files/ and try to rm -rf, Permission denied. Chown, same.

One thing I noticed: the permissions in the /run/user/1000/kio-fuse-VNSXQP/trash folder are dr-xr-xr-x 1 blumen users 4096 Nov  8 23:21 0-gitstuff, yet the permissions in ~/.local/share/Trash/files are drwxr-xr-x 26 blumen users  4096 Nov  8 23:21 gitstuff.
Comment 1 Nate Graham 2021-12-07 03:05:41 UTC
If you move that file outside of the trash, can you delete it or rm it?
Comment 2 Thiago Sueto 2022-01-15 23:20:57 UTC
(In reply to Nate Graham from comment #1)
> If you move that file outside of the trash, can you delete it or rm it?

I can't move it without sudo.

By the way, after facing this issue again, I noticed some unexpected behavior. If I build a project with cmake -B build -D CMAKE_EXPORT_COMPILE_COMMANDS=ON -D CMAKE_GENERATOR=Ninja and then install it directly on my system (sudo cmake --install build/ or sudo ninja install), the build folder gets the following permissions:

dr-xr-xr-x

which isn't removable without sudo (there are no write permissions). But somehow Dolphin manages to move the folder to /run/user/1000/kio-fuse-bnoNSf/trash if I delete it.

So what happens is: the user shouldn't be able to delete these files in the first place, yet Dolphin manages to send them to the trash.

Try it by building e.g. sddm_kcm exactly as I listed above and you should be able to reproduce it.
Comment 3 Thiago Sueto 2022-01-15 23:26:21 UTC
(Sorry, forgot to mention: if you're building with cmake, you need `cmake --build build` too before the --install command)