Bug 448926 - Delete options are not grayed out when a root-owned folder is in /home/user/
Summary: Delete options are not grayed out when a root-owned folder is in /home/user/
Status: REPORTED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-21 21:20 UTC by guimarcalsilva
Modified: 2023-07-05 21:35 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description guimarcalsilva 2022-01-21 21:20:23 UTC
SUMMARY

Tested in Dolphin and Konqueror.

STEPS TO REPRODUCE
1. Make a new file in a root-owned folder
2. Right-click
3. Select "Move to Trash"

OBSERVED RESULT

Right-clicking and selecting "Move to Trash" makes both Dolphin and Konqueror show this error (the file being deleted it Text File.txt): 

Access denied to /home/guilherme/.local/share/Trash/files/Text File.txt.

There's no prompt for the root password.

Deleting directly while holding the shift key works normally.

EXPECTED RESULT

It should either move the file to the current user's/root's trash or instead the context menu could hide the "Move to Trash" option and only show the delete option for root files.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3
Kernel Version: 5.13.0-27-generic (64-bit)
Graphics Platform: Wayland
Processors: 6 × Intel® Core™ i5-9400F CPU @ 2.90GHz
Memory: 7,6 GiB of RAM
Graphics Processor: Radeon RX 570 Series
Comment 1 Nate Graham 2022-01-23 19:21:27 UTC
Huh, works for me in Dolphin.
Comment 2 guimarcalsilva 2022-01-24 21:14:39 UTC
(In reply to Nate Graham from comment #1)
> Huh, works for me in Dolphin.

Weird. I tried making a new user to see if it would change anything but the same happened. Is there any kind of log or something I can send to help diagnose the issue?
Comment 3 Ahmad Samir 2022-05-05 11:48:42 UTC
What is the output of this in terminal:
ls -l /home/guilherme/.local/share/Trash/files/Text File.txt
ls -ld /home/guilherme/.local/share/Trash/files/
Comment 4 guimarcalsilva 2023-07-05 21:33:16 UTC
Hey. Sorry. I completely missed Ahmad's comment here and I only found this again because I was going through my reported bugs. I don't remember why when I reported this I was able to select 'Move to trash' for a file in a root-owned folder. Now I have a new fresh install of Neon User Edition 5.27.6 and, as expected, the option is grayed out on the context menu for files inside a root folder. However, the context menu still shows 'Move to trash' for root-owned folders in my home directory, so that's not fixed. I also cannot shift-delete as I said I could in the original post.

It's obvious that Dolphin shouldn't be able to delete root-owned folders without a password. What is buggy here is the fact the option to move the folder to the trash is not grayed out as it is everywhere else.

This bug only seems to apply to a root folder in the home directory. System folders in / have the option to move to the trash grayed out as expected, and files and other folders inside that problematic folder also have the delete options grayed out.

I'll write detailed instructions:

1. Open a terminal in your >home< (very important!) directory
2. Type sudo mkdir ./myfolder
3. Go to Dolphin or Konqueror and right-click the folder

Result: The option 'Move to trash' is available.

If I try to move the folder to the trash, it says: Access denied to /home/guilherme/.local/share/Trash/files/myfolder

As Ahmad asked, ls -ld /home/guilherme/.local/share/Trash/files/myfolder shows : 

ls: cannot access '/home/guilherme/.local/share/Trash/files/myfolder': No such file or directory

As expected, the folder doesn't exist because it wasn't moved to the trash due to the lack of permissions. The folder I'm trying to delete does exist though: drwxr-xr-x 2 root root 4096 jul  5 19:55 /home/guilherme/myfolder