Bug 375610 - Dolphin doesn't correctly show directories on a ftp server
Summary: Dolphin doesn't correctly show directories on a ftp server
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.29.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-27 11:25 UTC by Marco Scarpetta
Modified: 2017-02-01 11:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.31


Attachments
Patch to fix this issue (1.32 KB, patch)
2017-01-27 18:07 UTC, Marco Scarpetta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Scarpetta 2017-01-27 11:25:26 UTC
Dolphin doesn't correctly show directories on server ftp://ftp-dee.poliba.it

Inside root directory nothing is shown, while inside sub-directories names of some directories are truncated. Files are OK, I can see and open them.

This is what I get whit the ftp command:

[marco@marco-laptop ~]$ ftp ftp-dee.poliba.it
Connected to ftp-dee.poliba.it.
220-Welcome To DEI FTP Server
220 Service ready for new user
Name (ftp-dee.poliba.it:marco): ANONYMOUS
331 Password required
Password: 
230 User logged in
Remote system type is MACOS.
ftp> ls Corsi
200 PORT command successful
150 Opening connection
drwxr-xr-x               folder        0 Jan 16 20:13 AVVISI e COMUNICAZIONI
-rw-r--r--        0      150786   150786 Jan 16 20:12 calendario_esami_2017.pdf
drwxr-xr-x               folder        0 Sep 18  2014 ELETTRONICA  (Vecchio Ordinamento)
drwxr-xr-x               folder        0 Mar 15 15:50 ELETTRONICA  II  (Nuovo Ordinamento)
drwxr-xr-x               folder        0 Dec  5 20:11 ELETTRONICA DEI SENSORI
drwxr-xr-x               folder        0 Dec 20 11:35 FONDAMENTI DI ELETTRONICA
drwxr-xr-x               folder        0 Oct  3 16:32 PROVE DI LABORATORIO
drwxr-xr-x               folder        0 Apr 23 11:11 SEMINARIO ING. VACCA
drwxr-xr-x               folder        0 Apr 23 11:11 SEMINARIO PROF. E. CANTATORE (28_1_13)
226 Transfer complete
ftp>

Maybe the problem is that "Remote system type is MACOS."
Comment 1 Marco Scarpetta 2017-01-27 18:07:30 UTC
Created attachment 103671 [details]
Patch to fix this issue

I looked at the code and solved the issue. I'm attaching a patch if you want to accept it.
Comment 2 David Faure 2017-01-31 13:10:03 UTC
Nice, thanks for the patch.

https://git.reviewboard.de.org is a better tool for getting patches reviewed though.

I would like at least a comment that contains one of the lines that you show in this bug report, so someone can understand (and possibly modify) the parsing code even if the FTP site you mention no longer exists.
(yes we should have done that for the other cases too...)

The patch looks good otherwise (man we really should have some unittests for this parsing code, to make sure changes don't break anything...).
Comment 3 David Faure 2017-02-01 10:26:35 UTC
For reference: https://git.reviewboard.kde.org/r/129905/
(thanks!)
Comment 4 David Faure 2017-02-01 11:25:28 UTC
Git commit b158255bd590eb333e22526614b1a72611402b6a by David Faure, on behalf of Marco Scarpetta.
Committed on 01/02/2017 at 11:25.
Pushed by dfaure into branch 'master'.

Fix parsing of directories listing on a specific ftp server

Directories listing on ftp servers like ftp://ftp-dee.poliba.it/ are now parsed correctly.
REVIEW: 129905
FIXED-IN: 5.31

M  +13   -2    src/ioslaves/ftp/ftp.cpp

https://commits.kde.org/kio/b158255bd590eb333e22526614b1a72611402b6a