Bug 506593 - Unable to transfer files to a android device over SSHFS when filenames contain a colon
Summary: Unable to transfer files to a android device over SSHFS when filenames contai...
Status: REPORTED
Alias: None
Product: kdeconnect
Classification: Applications
Component: android-application (other bugs)
Version First Reported In: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-04 16:33 UTC by Taneli Tavi
Modified: 2025-07-12 22:24 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Taneli Tavi 2025-07-04 16:33:09 UTC
STEPS TO REPRODUCE
1. Mount a Android device filesystem using kdeconnect
2. touch "Test file: the test" && cp "Test file: the test"  /run/user/1000/(your_uuid_here)/storage/emulated/0/

OBSERVED RESULT
File not copied
"cp: cannot create regular file '/run/user/1000/(your_uuid_here)/storage/emulated/0/Test file: the test': Operation not permitted"

EXPECTED RESULT
File copied successfully

SOFTWARE/OS VERSIONS
Operating System: Bazzite 42
KDE Plasma Version: 6.4.0
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1

Android 15 /w Kdeconnect 1.33.4(F-Droid)

ADDITIONAL INFORMATION
Fails similarly from other systems as well, such as from my Alpine Linux laptop. Given that sshfs normally works fine from a Linux host to another with the same filename and the sshfs options used in kdeconnect do not seem to be the culprit, the issue is likely on the Android side.
Comment 1 Taneli Tavi 2025-07-04 17:15:05 UTC
(In reply to Taneli Tavi from comment #0)
> STEPS TO REPRODUCE
> 1. Mount a Android device filesystem using kdeconnect
> 2. touch "Test file: the test" && cp "Test file: the test" 
> /run/user/1000/(your_uuid_here)/storage/emulated/0/
> 
> OBSERVED RESULT
> File not copied
> "cp: cannot create regular file
> '/run/user/1000/(your_uuid_here)/storage/emulated/0/Test file: the test':
> Operation not permitted"
> 
> EXPECTED RESULT
> File copied successfully
> 
> SOFTWARE/OS VERSIONS
> Operating System: Bazzite 42
> KDE Plasma Version: 6.4.0
> KDE Frameworks Version: 6.15.0
> Qt Version: 6.9.1
> 
> Android 15 /w Kdeconnect 1.33.4(F-Droid)
> 
> ADDITIONAL INFORMATION
> Fails similarly from other systems as well, such as from my Alpine Linux
> laptop. Given that sshfs normally works fine from a Linux host to another
> with the same filename and the sshfs options used in kdeconnect do not seem
> to be the culprit, the issue is likely on the Android side.

It seems that the device(moto g32 running CalyxOS) uses sdcardfs on /data/media, so this is likely a strange edge-case. Regardless, the way Android filemanager for example handles colons on fat32/sdcardfs is to change them into underscores when moving or creating files with them, which would be preferred behavior as when trying to copy such files with Dolphin for example currently it fails silently.
Comment 2 MathieuM 2025-07-06 22:29:35 UTC
Hi!
Following your steps on a Motorola One Zoom on Android 10 throws me an error "cp: cannot create regular file '/run/user/1000/a68292ad40074001b55a6f8af16eba7d/Download/Test file: the test': No such file or directory", but the file is created both in / and in the target folder on the phone. Does the file not appear at all on the phone in the end for you?
Comment 3 Taneli Tavi 2025-07-07 00:53:34 UTC
(In reply to MathieuM from comment #2)
> Hi!
> Following your steps on a Motorola One Zoom on Android 10 throws me an error
> "cp: cannot create regular file
> '/run/user/1000/a68292ad40074001b55a6f8af16eba7d/Download/Test file: the
> test': No such file or directory", but the file is created both in / and in
> the target folder on the phone. Does the file not appear at all on the phone
> in the end for you?

Thank you for your response. No. Interesting that it transfers for you, mind sharing what filesystem your target folder is on? You can find this out for example using Termux, after installing mount-utils or through the adb shell by just typing "mount".
Comment 4 MathieuM 2025-07-07 08:49:28 UTC
(In reply to Taneli Tavi from comment #3)
> (In reply to MathieuM from comment #2)
> > Hi!
> > Following your steps on a Motorola One Zoom on Android 10 throws me an error
> > "cp: cannot create regular file
> > '/run/user/1000/a68292ad40074001b55a6f8af16eba7d/Download/Test file: the
> > test': No such file or directory", but the file is created both in / and in
> > the target folder on the phone. Does the file not appear at all on the phone
> > in the end for you?
> 
> Thank you for your response. No. Interesting that it transfers for you, mind
> sharing what filesystem your target folder is on? You can find this out for
> example using Termux, after installing mount-utils or through the adb shell
> by just typing "mount".

The target folder is on my SD Card, which seems to be of sdcardfs Filesystem (using DiskInfo to find out)
Comment 5 Mohammed Aquib Azad 2025-07-12 22:24:58 UTC
I ran a stacktrace and the filesystem basically stopped me from creating a file with ':' in the filename. Android basically does not allow files with case the following characters -   * / : < > ? \ | 

Linux does allow : for some reason. I think Linux allows some of these characters, I tested : and ? works. We can have a workaround where we replace any of these characters, but I don't if this is a high priority item. I can probably fix this, but I don't see this being an issue.