A long time ago I ran into a problem when none of the clients, such as Filezilla, Far FTP Plugin, Far Navigator, and others, can display the contents of directories when connecting to the server.
FAR FTP Plugin swears that it can not parse the output, Filezilla shows files by mixing the date and file name and does not allow to move along directories.
As it turned out, ftpd inherits the locale of the user who started or restarted the daemon via /etc/rc.d/ and gives the data in this locale to all clients that connect to the server.
Having LANG = ru_RU.UTF-8 (ru_RU.KOI8-R) and restarting ftpd via /etc/rc.d/ftpd restart, when connected via a regular ftp client, we get the following image.
ftp> ls test
229 Entering Extended Passive Mode (|||64671|)
150 Opening ASCII mode data connection for '/bin/ls'.
total 212
-rw-r--r-- 1 aborche wheel 15457 23 ╟©─ 10:51 crypttest.txt
-rw-r--r-- 1 aborche wheel 193509 29 ▐Ґ╡ 2009 falling_into_a_black_hole.jpg
drwxr-xr-x 2 aborche wheel 512 27 ╟╡ 11:36 geo
drwxr-xr-x 2 aborche wheel 512 27 ╟╡ 11:36 release
drwxr-xr-x 3 aborche wheel 512 27 ╟╡ 11:36 scripts
226 Transfer complete.
Accordingly, the same output curve is given to all other clients who simply cannot parse the data. Therefore, the file name interferes with the date or nothing is shown at all. If suddenly the client is able to use full UTF-8, then the received output will still be correctly visible in the client, but the client will not be able to do anything with the files.
')
when restarting ftpd with LANG = C, everything returns to normal.
ftp> ls test
229 Entering Extended Passive Mode (|||64395|)
150 Opening ASCII mode data connection for '/bin/ls'.
total 212
-rw-r--r-- 1 aborche wheel 15457 Apr 23 10:51 crypttest.txt
-rw-r--r-- 1 aborche wheel 193509 Jan 29 2009 falling_into_a_black_hole.jpg
drwxr-xr-x 2 aborche wheel 512 Aug 27 11:36 geo
drwxr-xr-x 2 aborche wheel 512 Aug 27 11:36 release
drwxr-xr-x 3 aborche wheel 512 Aug 27 11:36 scripts
226 Transfer complete.
The problem is that the startup scripts do not clean the value of LANG, inheriting it from the current user.
Keep this in mind when setting up servers.
(C) Aborche 2009
