Bug 478839 - Strange trash-related warnings in the system journal
Summary: Strange trash-related warnings in the system journal
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Trash (show other bugs)
Version: 5.247.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-12-21 14:10 UTC by Jin Liu
Modified: 2024-01-09 17:30 UTC (History)
3 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 Jin Liu 2023-12-21 14:10:38 UTC
SUMMARY
System journal has the following warnings:

kioworker: kf.kio.workers.trash: Root trash dir "/\u0000/.Trash" exists but didn't pass the security checks, can't use it
kioworker: kf.kio.workers.trash: Directory "/\u0000/.Trash-1000" exists but didn't pass the security checks, can't use it

I checked that the dir "/\u0000/.Trash" doesn't exist. So probably KIO actually tries to use the NUL(\u0000)-terminated path "/" as the trash dir.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.91.0
KDE Frameworks Version: 5.247.0
Qt Version: 6.7.0
Kernel Version: 6.6.7-arch1-1 (64-bit)
Graphics Platform: offscreen
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 Bug Janitor Service 2024-01-04 13:16:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/solid/-/merge_requests/154
Comment 2 Jin Liu 2024-01-04 13:25:21 UTC
I've located the source of this bug, but I can't decide how to fix it.

There are two problems:
1. Solid::StorageAccess::filePath() returns `/\u0000` for encrypted root partition. Should be fixed in https://invent.kde.org/frameworks/solid/-/merge_requests/154

2. In KIO:
https://invent.kde.org/frameworks/kio/-/blob/287aa2ab7c3277b5d5033952569c38bb308a6154/src/kioworkers/trash/trashimpl.cpp#L1053
The query to Solid returns both the encryped root partition and the devicemapper. And after the fix above, their filepath() should both resolve to `/`. This doesn't really cause problems here, but is it intentional?

a) Should the `Solid::Device::listFromQuery(QStringLiteral("StorageAccess.accessible == true"))` query, by design, return both devices?
b) If a) is true, then should KIO somehow explicitly filter out the encrypted partition?
Comment 3 Jin Liu 2024-01-09 17:30:32 UTC
Git commit 762c62524c3e91ce21b6dfe7c349eca577269009 by Jin Liu, on behalf of Jin Liu.
Committed on 08/01/2024 at 08:35.
Pushed by genericity into branch 'master'.

Fix: StorageAccess::filePath() returns /\u0000 for encrypted root

M  +5    -1    src/solid/devices/backends/udisks2/udisksstorageaccess.cpp

https://invent.kde.org/frameworks/solid/-/commit/762c62524c3e91ce21b6dfe7c349eca577269009