Bug 406901 - Files with special characters can't be copied
Summary: Files with special characters can't be copied
Status: RESOLVED NOT A BUG
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-25 20:41 UTC by michael.wagner
Modified: 2019-05-03 15:11 UTC (History)
2 users (show)

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


Attachments
logcat during copy (74.40 KB, text/x-log)
2019-04-25 20:41 UTC, michael.wagner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description michael.wagner 2019-04-25 20:41:55 UTC
Created attachment 119637 [details]
logcat during copy

SUMMARY
Files with several special characters fail to be copied using KDEconnect via Dolphin.

STEPS TO REPRODUCE
1. Configure a storage location on the Android phone
2. Browse the directory with dolphon
3. copy files containing special characters including :?"*\<>|

OBSERVED RESULT
Files are not copied, instead, an empty file with a truncated name is created.


EXPECTED RESULT
Files are copied, regardless of their name.

SOFTWARE/OS VERSIONS
Windows: -
macOS: -
Linux/KDE Plasma: Kubuntu 18.10, Kernel 4.18.0-17-generic
(available in About System)
KDE Plasma Version: 5.12.7
KDE Frameworks Version: 5.44.0
Qt Version: 5.9.5
kdeconnect: 1.3.3-0ubuntu0.18.04.1
Android App: 1.12.6
Mobile Phone: Samsung Galaxy S9 with latest Software (Android 9)

ADDITIONAL INFORMATION
I tried to copy following textfiles (with 6 bytes each):
test@vademecum:~$ ls -l /home/test/testfolder/
insgesamt 120
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfilen ().txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile öäü.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile ß.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile `.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile ^.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile ~.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile < >.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile =.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile |.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile °.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile _.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile -.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile , ;.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile :.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile !.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile ?.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 "testfile '.txt"
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile ".txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile [ ].txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile { }.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile §.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile $.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile *.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile \.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile &.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile #.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile %.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile +.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile ⁄.txt'
-rw-r--r-- 1 test test 6 Apr 24 23:53 'testfile with a long filename 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901.txt'


The listing of the destination-folder (on the phone) after copying:

test@vademecum:~$ ls -al /run/user/1001/dda7056acec3b75d/Folder/
insgesamt 92
-rw-rw-rw- 1 test test 0 Apr 25 22:25 'testfile _ (1).txt'
-rw-rw-rw- 1 test test 0 Apr 25 22:25 'testfile _ (2).txt'
-rw-rw-rw- 1 test test 0 Apr 25 22:25 'testfile _ (3).txt'
-rw-rw-rw- 1 test test 0 Apr 25 22:25 'testfile _ (4).txt'
-rw-rw-rw- 1 test test 0 Apr 25 22:26 'testfile _ (5).txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfilen ().txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile öäü.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile ß.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile `.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile ^.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile ~.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile =.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile °.txt'
-rw-rw-rw- 1 test test 0 Apr 25 22:26 'testfile _ _.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:25 'testfile _.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:25 'testfile -.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:25 'testfile , ;.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:25 'testfile !.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:25 "testfile '.txt"
-rw-rw-rw- 1 test test 6 Apr 25 22:25 'testfile [ ].txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:25 'testfile { }.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:25 'testfile §.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile $.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:25 'testfile &.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile #.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile %.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile +.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile ⁄.txt'
-rw-rw-rw- 1 test test 6 Apr 25 22:26 'testfile with a long filename 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901.txt'

logcat of the whole procedure is attached.
Comment 1 Erik Duisters 2019-04-27 17:44:36 UTC
Android replaces characters it does not like by '_' and there is no way for dolphin to know what the new filename will be. This cannot be fixed but I will remove the empty files so the file system will not get cluttered with them
Comment 2 michael.wagner 2019-04-30 10:25:33 UTC
What I forgot to mention: every time this happens, dolphin reports an error, which interrupts bulk-copies.
Can you somehow avoid that, e.g. by renaming the file in advance (resp: give the destination a different name than the source, with escaped 'dangerous' characters)?
Comment 3 Erik Duisters 2019-05-03 15:11:42 UTC
Empty files due to android renaming invalid characters are now removed see commit: c7a4f76f2bf53eb6a26670fd79b8fff920309c85