ProFTPD - iconv() charset conversion patch

Japanese?


What's this?

ProFTPD is a ftp server program, widely used in Linux distributions. This iconv patch enables proftpd to support charset conversion.

  • converting charset of directory listing -- LIST -- command output. (server charset -> client charset)
  • converting charset of ftp command input. (client charset -> server charset)

are supported.


Download

Download these files and apply them to original ProFTPD patch.


configure

After applying patch, run configure script with settings to enable charset conversion module.

  • Run configure with "--with-modules=mod_codeconv" to enable charset conversion module.
  • (Run configure with "--with-modules=mod_codeconv:mod_df" to enable charset conversion module and disk freespace reporting module. The disk freespace reporting module displays disk freespace when clients issue chdir command.)

For example:

./configure --prefix=/usr/local/v6 --enable-ipv6 --enable-sendfile --with-modules=mod_codeconv:mod_df

The newly compiled ProFTPD will be installed into (--prefix directory)/sbin after "make" and "make install". If you want to install configuration file (proftpd.conf) and executables (proftpd and so on) into other directories, use configure options like --sysconfdir and --exec-prefix.


Setting

Add charset conversion settings to proftpd.conf.

Use "CharsetLocal" directive to specify server's filesystem charset, and use "CharsetRemote" directive to specify client charset. For instance, if server's filesystem is EUC-JP-MS (Japanese local charset for UNIX) and client charset is CP932 (Windows Shift-JIS charset), add settings like this:

CharsetLocal           EUC-JP-MS
CharsetRemote          CP932

If your server uses <VirtualHost> tags, add CharsetLocal/CharsetRemote setting to each VirtualHost region. If you add the settings only in global region, the charset conversion is disabled in VirtualHosts.

EUC-JP-MS is a new charset, only supported by glibc 2.3.3 or newer. If you use old glibc libraries, specify like this:

CharsetLocal           EUC-JP
CharsetRemote          SJIS

(EUC-JP/SJIS charsets don't support Windows-specific characters. This patch is not recommended for environments with old glibc libraries.)

To know what charsets your iconv() supports, use "iconv -l" command.

% iconv -l 
The following list contain all the coded character sets known.  This does
not necessarily mean that all combinations of these names can be used for
the FROM and TO command line parameters.  One coded character set can be
listed with several different names (aliases).

  437, 500, 500V1, 850, 851, 852, 855, 856, 857, 860, 861, 862, 863, 864, 865,
  866, 866NAV, 869, 874, 904, 1026, 1046, 1047, 8859_1, 8859_2, 8859_3, 8859_4,
  8859_5, 8859_6, 8859_7, 8859_8, 8859_9, 10646-1:1993, 10646-1:1993/UCS4,
  ANSI_X3.4-1968, ANSI_X3.4-1986, ANSI_X3.4, ANSI_X3.110-1983, ANSI_X3.110,
  ARABIC, ARABIC7, ARMSCII-8, ASCII, ASMO-708, ASMO_449, BALTIC, BIG-5,
  BIG-FIVE, BIG5-HKSCS, BIG5, BIG5HKSCS, BIGFIVE, BS_4730, CA, CN-BIG5, CN-GB,
  CN, CP-AR, CP-GR, CP-HU, CP037, CP038, CP273, CP274, CP275, CP278, CP280,
(suppressed)

UTF-8

If your iconv() supports UTF-8, this patch can use it.

If your server uses UTF-8 in filesystem and clients use Windows/CP932 charsets, add settings like:

CharsetLocal           UTF-8
CharsetRemote          CP932

If clients use BIG-5, GB2312, and so on, change CharsetRemote.


<- Up


Copyright © 1999-2003 by T.Tsujikawa / All rights reserved.