When the MTP slave is asked to perform cat, it retrieves something very different from what has been copied to the device. Reproducible: Sometimes Steps to Reproduce: 0. Have a phone LG-E430 connected to the computer via USB. 1. { tURL='mtp:/LG-E430/Pami%C4%99%C4%87%20wewn%C4%99trzna/' date >empty && ls -l empty && kioclient cp empty "$tURL" && kioclient cat "${tURL}empty" | wc } Actual Results: 1. empty: 32 bytes, wc: 3928828 bytes; the content returned is unrecognised binary blob Expected Results: 1. empty: 32 bytes, wc: 32 bytes and content equal to the content of empty The file on the phone has 32 bytes as expected. Sometimes cat returns nothing, in which case I may get one of the following messages: * The directory mtp:/LG-E430/ does not exist. * LIBMTP PANIC: failed to open session on second attempt kioslave: ####### CRASH ###### protocol = mtp pid = 6429 signal = 11
Oh, I forgot to mention: this bug means that files residing on the phone cannot be opened, they can only be copied. Maybe it is a good thing, but then it should be explicitly prohibited rather than mysteriously fail.
This also affects saving documents (as opposed to copying them), the command tells me that the target exists (even though it does not) and then silently fails.
Git commit aaa1edbb74c4fb01affbde7b79bb45d3a9b61f83 by Andreas Krutzler. Committed on 08/10/2018 at 17:39. Pushed by akrutzler into branch 'master'. [mtp] Move MTP device handling from kioslave to kiod-module Summary: Consult T9390 for more information. Related: bug 319880, bug 325924, bug 372860, bug 382046, bug 383314, bug 396527 Closes T9390 Reviewers: elvisangelaccio, ltoscano, hetzenecker, dfaure, mlaurent Reviewed By: elvisangelaccio, dfaure, mlaurent Subscribers: mlaurent, kde-frameworks-devel, kfm-devel Tags: #dolphin, #frameworks Maniphest Tasks: T9390 Differential Revision: https://phabricator.kde.org/D15277 M +5 -5 mtp/CMakeLists.txt D +0 -229 mtp/devicecache.cpp D +0 -86 mtp/devicecache.h D +0 -73 mtp/filecache.cpp D +0 -81 mtp/filecache.h M +483 -576 mtp/kio_mtp.cpp M +14 -8 mtp/kio_mtp.h D +0 -358 mtp/kio_mtp_helpers.cpp D +0 -46 mtp/kio_mtp_helpers.h A +19 -0 mtp/kiod_module/CMakeLists.txt A +171 -0 mtp/kiod_module/kmtpd.cpp [License: GPL (v2+)] A +63 -0 mtp/kiod_module/kmtpd.h [License: GPL (v2+)] A +12 -0 mtp/kiod_module/kmtpd.json A +127 -0 mtp/kiod_module/mtpdevice.cpp [License: GPL (v2+)] A +78 -0 mtp/kiod_module/mtpdevice.h [License: GPL (v2+)] A +635 -0 mtp/kiod_module/mtpstorage.cpp [License: GPL (v2+)] A +142 -0 mtp/kiod_module/mtpstorage.h [License: GPL (v2+)] A +21 -0 mtp/shared/CMakeLists.txt A +70 -0 mtp/shared/kmtpdeviceinterface.cpp [License: LGPL] A +64 -0 mtp/shared/kmtpdeviceinterface.h [License: LGPL] A +85 -0 mtp/shared/kmtpdinterface.cpp [License: LGPL] A +70 -0 mtp/shared/kmtpdinterface.h [License: LGPL] A +147 -0 mtp/shared/kmtpfile.cpp [License: LGPL] A +90 -0 mtp/shared/kmtpfile.h [License: LGPL] A +98 -0 mtp/shared/kmtpstorageinterface.cpp [License: LGPL] A +77 -0 mtp/shared/kmtpstorageinterface.h [License: LGPL] A +50 -0 mtp/shared/org.kde.kmtp.daemon.xml A +62 -0 mtp/shared/org.kde.kmtp.device.xml A +154 -0 mtp/shared/org.kde.kmtp.storage.xml https://commits.kde.org/kio-extras/aaa1edbb74c4fb01affbde7b79bb45d3a9b61f83