GNOME Bugzilla – Bug 112463
Use D. J. Bernstein's FTP LIST parser
Last modified: 2006-03-19 17:29:21 UTC
I came across this page in random surfing, and thought it might be useful for gnome-vfs, having had some experience working with the ftp module's LIST parsing algorithms. http://cr.yp.to/ftpparse.html It's available as a C source file and header, so it can easily be compiled and linked with the ftp module. It's not LGPL, so I don't know what legal issues are involved. djb only says at the bottom of the page: "Commercial use of ftpparse is fine, as long as you let me know what programs you're using it in."
The first question that comes to mind is: « what's wrong with the current parser ? Are there bugs in it, sites that it doesn't handle properly ? »
The current parser handles Unix, Windows/MSDOS, and Netware. Although this covers the vast majority of ftp servers, it doesn't cover as many as Bernstein's parser claims to cover. However, you raise a good point. The current parser is working for most ftp servers. As long as people are happy with it, there is not a good reason to replace it. FYI: A few related bugs... Bug 41182 - some cases not handled by ls parser Bug 86280, Bug 86862 - both deal with Microsoft FTP servers
Well, this could be nice. I guess we'll need to see if DJB would be happy for us to put it in an LGPL library. His license doesn't seem to quite be LGPL compatible though. I'll email him and see what he says.
Ian: *ping* Did you ever get a reply?
I looked at the code today and it seems to use tons of global vars. This is a no go since it's not threadsafe at all! We would at least need to rewrite great parts of it! I think it's better to fix the current parser!
Also see bug 163671 - and consider that there may be other overflow cases in gnome_vfs_parse_ls_lga, whereas this is very unlikely in djb's code.
Well there still is the license problem and the tons of global vars. If someone volunteers to ask him again - get proper response, and attach a threadsafe patch here, I will think about it ;) Until then this is not going to happen anytime soon!
We have actually fixed most of the ls parsing issues, all associated bug reports are closed. Please open bug reports as you encounter more of them. This is just not going to happen for license and coding style reasons.