RFC: ftpd, increase compatibility with RFC-violating clients

Stefan Seyfried stefan.seyfried at googlemail.com
Sun Jan 17 23:43:26 UTC 2010


Hi Denys,

On Sun, 17 Jan 2010 22:42:02 +0100
Denys Vlasenko <vda.linux at googlemail.com> wrote:

> Since this patch increases code size, and breaks unlikely
> but legal attempts to LIST files whose names start with dash,
> it should be conditional.
> 
> Please wrap it in a CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST or something.

Ok, I have done this in the attached patch. Checked that it does not
change anything if it is not enabled. Bloatcheck this time reported
33 Bytes, but on x64, not on arm.

One could argue if it should default to yes or no, I'm not religious
about that.
Since other ftp-servers (vsftpd for sure) are not that "pedantic", I'd
vote for turning it on. I still need to check how they handle a file
name "-la", though ;)

> On https://bugs.kde.org/show_bug.cgi?id=195578 you can mention that
> there are newer, more robust FTP commands to retrieve file attributes
> than LIST, like MLST, MLSD, SIZE, MDTM.

I actually wanted to cook up a patch for KDE, but the effort of setting
up everything needed to actually test it has always deferred that
project to "later" ;) There are probably other affected clients, I had
also reports from windows users that had problems with busybox ftpd.
I'm still waiting for their feedback on which clients they used, though.

> > Implementation note: I reused the cwd variable in the assumption that
> > this would save some code size. I'm not sure if it does.
> 
> It gets passed to free() later, so you must not do that.
> Just use a local variable, it's not such a big deal.
> 
> Actually, the code in git was stupid (it was allocating cwd
> even on MMU, where it wasn't needed). Fixed. Please base new patch
> on current (updated) git.

Done, attached.

-- 
Stefan Seyfried

"Any ideas, John?"
"Well, surrounding them's out."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-ftpd-compatibility-with-RFC-violating-clients.patch
Type: text/x-patch
Size: 2345 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100118/ef772e28/attachment.bin>


More information about the busybox mailing list