Bug 509191 - Can't write or paste to some folders even when running as root [PATCH attached]
Summary: Can't write or paste to some folders even when running as root [PATCH attached]
Status: ASSIGNED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.17.0
Platform: NixOS Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-06 13:10 UTC by Tomasz Borowik
Modified: 2025-09-27 11:18 UTC (History)
2 users (show)

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


Attachments
fix root permissions check patch (771 bytes, patch)
2025-09-06 13:10 UTC, Tomasz Borowik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Borowik 2025-09-06 13:10:10 UTC
Created attachment 184766 [details]
fix root permissions check patch

[details and patch at the bottom]
When running dolphin as root it performs read/write checks as if it were a normal user often blocking moving to user folders which don't have .

STEPS TO REPRODUCE
1. run as root
2. in a console do: mkdir test; chown user test; chmod go-rwx test
    note: replace user with whatever username you have available
3. open dolphin
    note: doing step 2 from inside dolphin doesn't trigger the issue!
4. try to copy/paste some file into folder test

OBSERVED RESULT
5. dolphin refuses to paste showing a red "Cannot paste: You do not have permission to write into this folder." message

EXPECTED RESULT
5. dolphin should allow pasting

Dolphin: 25.08.0
KDE Frameworks: 6.17.0
Qt: Using 6.9.1 and built against 6.9.1
NixOS 25.11 (Xantusia) (Xcb)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.16.1

DETAILS and PATCH
From what I've found the issue is with KFileItem::isReadable() & isWritable().
I made a simple patch that first checks if KUserId::currentUserId().nativeId() == 0 and returns true.
Verified the patch fixes the problem.
Note I don't work much with kde/plasma/qt code so there could be better ways to fix this.
Comment 1 Nate Graham 2025-09-25 16:57:47 UTC
Thanks for the patch! As you've no doubt observed, patches in bug reports tend to be missed by developers. Can I ask you to submit it as a merge request at https://invent.kde.org/frameworks/kio/-/merge_requests?

Here's the documentation for how to do that: https://community.kde.org/Infrastructure/GitLab#Submitting_a_merge_request

Thanks again!
Comment 2 Bug Janitor Service 2025-09-27 11:18:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/2008