For vsftpd to convert encoding between server and client.
This use below option in /etc/vsftpd/vsftpd.conf to determine which encoding is used by server and which is for client
# for charset
this patch use iconv(iconv.h) in your system to do the encoding converting, and it also add the UTF8 feature for vsftpd.
fix the characters bug in Chinese logging
Created attachment 137370 [details, diff]
encoding converting patch
Applied this patch use the ebuild below
Created attachment 137372 [details, diff]
patch for chinese log.
use ebuild below to apply it
Created attachment 137374 [details]
ebuild to use the two patches methioned
the ebuild modified to apply the above pathes.
It is for the filename encoding converting.
Why not send this upstream?
Created attachment 157171 [details]
encoding patch updated for vsftpd-2.0.6
Updated encoding patch for vsftpd-2.0.6.
Desptite porting the patch, I removed some code duplication and fixed code identation and style according to the original style of vsftpd.
However, it has one niptick inherited from previous version of a patch: OPTS UTF8 ON/OFF will do nothing, but it should enable/disbale charset conversion IMO.
Well, this patch works ok for me, but it is not tested well. After some security cheks I'll send it to mainstream.
Created attachment 157173 [details]
ebuild for vsftpd-2.0.6
And this is my ebuild for updated patch and vsftpd-2.0.6.
Created attachment 157271 [details, diff]
support OPTS UTF8 ON/OFF at runtime
This is an updated patch. It supports turning original UTF8 pathname transfer on and off via OPTS UTF8 ON/OFF commands. And the user is informed in all possible ways about this possibility.
However, this is still a break of RFC2640 (ftp i18n). But this patch is breakage of UTF8 feature by definition.
Created attachment 157277 [details]
trivial ebuild update
And this is absolutely trivial ebuild update.
Created attachment 157299 [details, diff]
do not allow to turn utf8 off if charset conversion was not enabled in config
This patch doesn't allow to turn utf8 off if charset conversion was not enabled in config. It makes vsftpd behaviour the same of an unpathed version if charset conversion was not enable in config file explicitely.
This seems more secure for me )). Will mail to vsftpd author shortly.
Created attachment 162860 [details, diff]
Update for v2.0.7
This is an updated patch for vsftpd-2.0.7.
Also it fixes charset conversion bug, where FTP control connection read from clients using SSL leads to double converted data.
Created attachment 162861 [details]
ebuild update for v2.0.7
Now charset conversion will be enabled only if "iconv" USE flag is set.
Andrew, have you seen package from bug 261730? I think net-ftp/vsftpd-devnet package covers all features this patch provides. Actually vsftpd-devnet provides even more features that's why new package was suggested there.
Closing this bug UPSTREAM since we have package with similar functionality in Sunrise overlay. OTOH this doesn't mean that we reject alternative implementations but anyway this feature request should either go upstream or some new project should be created to maintain this patch (like it's done on vsftpd.devnet.ru)
Or do I miss anything? If yes, please, reopen this bug.
(In reply to comment #13)
> Andrew, have you seen package from bug 261730? I think net-ftp/vsftpd-devnet
> package covers all features this patch provides. Actually vsftpd-devnet
> provides even more features that's why new package was suggested there.
Yes, I use it for a rather long time, since I tired to patch and debug each new version of original vsftpd. However, vsftpd from devnet has its own bugs, but they are minor.