RFC: ftpd, increase compatibility with RFC-violating clients

Denys Vlasenko vda.linux at googlemail.com
Sun Jan 17 21:42:02 UTC 2010


On Sunday 17 January 2010 14:25, Stefan Seyfried wrote:
> Hi,
> 
> there are ftp-clients in the wild (Konqueror among them) which send
> "LIST -la" or "LIST -l" in order to get a directory listing.
> Even though this is against RFC959, I guess that those clients are not
> going away soon, so I hacked up a patch to just skip the first Argument
> starting with "-".
> I know there might be more cases of broken clients, but I'd fix them
> once we run into them ;)
> 
> Patch attached additionally, you should be able to apply with "git am"
> if you deem it ok.

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.

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.

> 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.

--
vda


More information about the busybox mailing list