Summary: | Virtual symlinks to large files are not visible | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Jonathan Doman <jonathan.doman> |
Component: | general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | archer_ame, kdelibs-bugs |
Priority: | NOR | ||
Version: | 5.26.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kio/44512b6acbe6bb1c595e330bef702a0100d7bd4b | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Correcting the buffer size for readlink. |
Description
Jonathan Doman
2016-09-24 05:47:40 UTC
After a little debugging, I figured out that dolphin relies on KIO for directory listings, and I confirmed the bug is in KIO with a simple test program that basically calls KCoreDirLister::openUrl("file://.../tmsu-mp/tags/file") Created attachment 101724 [details]
Correcting the buffer size for readlink.
Maybe I'm encountering the same bug and found the cause.
Could you try this patch?
(Since I am not a programmer, I do not know whether this patch is appropriate.)
I'm sorry, it was not appropriate =( I'm sorry, it was completely inappropriate... The cause of this bug seems that lstat returns strange size of symlink on some filesystem (for me, it returns 0 on /proc/self , /sys/bus/cpu/devices/* and so on) and then readlink fail. I tried to send a patch to the review board. https://git.reviewboard.kde.org/r/129259/ Thanks for that patch. I think you definitely found the bug - I can see the "readlink failed!" warning message in the system journal. Git commit 44512b6acbe6bb1c595e330bef702a0100d7bd4b by Andreas Hartmetz, on behalf of Taro Yamada. Committed on 29/10/2016 at 19:13. Pushed by ahartmetz into branch 'master'. Sanitize the symlink name buffer size. Currently, KIO uses lstat to get the buffersize for readlink. But in certain situations, it returns an inappropriate value. For example, "/proc/self" or "/sys/bus/cpu/devices/*" returns its size is 0, and then readlink fails with EINVAL (so the link won't be shown in KDE applications). TMSU seems to return the target's actual filesize instead of the link size, i.e. the length of the target's filename. This patch limits the initial buffer size to sane values and expands the buffer when needed. The behavior is similar to ls, so it should be compatible with all filesystems. REVIEW: 129259 M +16 -6 src/ioslaves/file/file.cpp http://commits.kde.org/kio/44512b6acbe6bb1c595e330bef702a0100d7bd4b |