Fix can't enter directory error on some FTP servers with Turkish locale
ClosedPublic

Authored by nxiss7 on Jul 12 2019, 12:56 PM.

Details

Summary

Some Android FTP server applications don't implement lower-case "list" command thus KIO can't connect to server and fail with error "Can't enter directory."
Sending upper-case "LIST" command works.

Edit: It turns out that the application ignores the case (using toUpperCase() function of java.lang.String) .
But on Turkish locale, lower-case 'i' converted to upper-case 'İ' instead of 'I' thus client receives "Command not implemented" result.
I assume this bug would cause problems on other servers that run with Turkish locale.

BUG: 409740

Test Plan

1 - Change Android system language to Turkish.
2 - Start FTP server using ES File Manager 3.2.5.
3 - Connect to server using Dolphin.
4 - It should work without errors.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
nxiss7 created this revision.Jul 12 2019, 12:56 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 12 2019, 12:56 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
nxiss7 requested review of this revision.Jul 12 2019, 12:56 PM
nxiss7 added a reviewer: Frameworks.
nxiss7 edited the test plan for this revision. (Show Details)Jul 12 2019, 3:50 PM

According to the RFC, the server should ignore case:

Upper and lower case alphabetic characters are to be treated
identically. Thus any of the following may represent the retrieve
command:

RETR Retr retr ReTr rETr

I'm not sure how many buggy servers we should add workarounds for. One thing is the -a option which I'm not sure is actually standardized.

This comment was removed by nxiss7.

ES File Manager 3.2.5 has this issue.

nxiss7 changed the visibility from "Public (No Login Required)" to "All Users".Jul 15 2019, 9:05 PM
bcooksley changed the visibility from "All Users" to "Public (No Login Required)".Jul 16 2019, 10:00 AM

Instead of sending another command, should we refactor all FTP commands to upper case for better compatibility (as suggested by muesli) ?

aacid added a subscriber: aacid.Jul 16 2019, 1:27 PM

Why is uppercase only better compatibility if the spec clearly says that case doesn't matter ?

nxiss7 edited the summary of this revision. (Show Details)Jul 19 2019, 1:04 PM
nxiss7 edited the test plan for this revision. (Show Details)
nxiss7 updated this revision to Diff 62067.EditedJul 19 2019, 5:16 PM
nxiss7 edited the summary of this revision. (Show Details)

Updated comment to describe the actual problem.

nxiss7 retitled this revision from Fix cant enter directory error on Android FTP servers to Fix can't enter directory error on Android FTP servers with Turkish locale.Jul 20 2019, 1:07 PM
nxiss7 retitled this revision from Fix can't enter directory error on Android FTP servers with Turkish locale to Fix can't enter directory error on some FTP servers with Turkish locale.Jul 20 2019, 1:52 PM
dfaure accepted this revision.Jul 20 2019, 3:35 PM
dfaure added a subscriber: dfaure.

So it's a bug in the android FTP server? Nice ;-)

They should learn from Qt, where QString::toUpper uses the C locale, and one has to use QLocale for locale-aware conversion.

Please move the comment about Turkish locale 2 lines down, though, just above the uppercase LIST command, since that's what the comment is about.

This revision is now accepted and ready to land.Jul 20 2019, 3:35 PM
nxiss7 updated this revision to Diff 62133.Jul 20 2019, 5:14 PM
dfaure accepted this revision.Jul 20 2019, 5:17 PM
aacid added a comment.Jul 20 2019, 6:37 PM

nxisss can we have your real name and email for commit this to the codebase?

nxisss can we have your real name and email for commit this to the codebase?

Enes Selim
nxiss7@gmail.com

aacid closed this revision.Jul 21 2019, 8:36 AM