<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>336456</bug_id>
          
          <creation_ts>2014-06-19 17:26:01 +0000</creation_ts>
          <short_desc>The MTP slave incorrectly performs cat</short_desc>
          <delta_ts>2018-10-08 17:39:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>kio-extras</product>
          <component>MTP</component>
          <version>18.04.3</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>mtp:/LG-E430/Pami%C4%99%C4%87%20wewn%C4%99trzna/object.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Christopher Yeleighton">giecrilj</reporter>
          <assigned_to name="Philipp Schmidt">kde-bugs</assigned_to>
          
          
          <cf_commitlink>https://commits.kde.org/kio-extras/aaa1edbb74c4fb01affbde7b79bb45d3a9b61f83</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1456362</commentid>
    <comment_count>0</comment_count>
    <who name="Christopher Yeleighton">giecrilj</who>
    <bug_when>2014-06-19 17:26:01 +0000</bug_when>
    <thetext>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=&apos;mtp:/LG-E430/Pami%C4%99%C4%87%20wewn%C4%99trzna/&apos;
date &gt;empty &amp;&amp; ls -l empty &amp;&amp;
kioclient cp empty &quot;$tURL&quot; &amp;&amp;
kioclient cat &quot;${tURL}empty&quot; | 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1456364</commentid>
    <comment_count>1</comment_count>
    <who name="Christopher Yeleighton">giecrilj</who>
    <bug_when>2014-06-19 17:28:26 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1457756</commentid>
    <comment_count>2</comment_count>
    <who name="Christopher Yeleighton">giecrilj</who>
    <bug_when>2014-06-25 14:13:35 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1792544</commentid>
    <comment_count>3</comment_count>
    <who name="">andreas.krutzler</who>
    <bug_when>2018-10-08 17:39:48 +0000</bug_when>
    <thetext>Git commit aaa1edbb74c4fb01affbde7b79bb45d3a9b61f83 by Andreas Krutzler.
Committed on 08/10/2018 at 17:39.
Pushed by akrutzler into branch &apos;master&apos;.

[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</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>