GNOME Bugzilla – Bug 350052
FTP - incorrect handling of filenames starting with years
Last modified: 2007-03-30 07:53:06 UTC
Please describe the problem: If a filename on an FTP-site starts with a year (yyyy), it is interpreted incorrectly by Nautilus: http://www.arumes.com/temp/ftp-error.png Steps to reproduce: Should be obvious. Create a file with the name "yyyy blablabla.bla" (include the whitespace), move it to an FTP-site, and view it in Nautilus. Actual results: Nautilus will show it as "blablabla.bla", with yyyy used as the creation-year. When you try to acces/move/delete/whatever the file, you'll get a "File not found" error. Expected results: Do I need to fill this in? :-) Does this happen every time? yes Other information:
Thanks for your bug report! Reassigning to GnomeVFS. The issue is that gnome_vfs_parse_ls_lga parses considers this a date, because it almost looks like "Month Day Time Year" (except for the additional space between Time and Year), cf. libgnomevfs/gnome-vfs-parse-ls.c. I fear that we might break other servers that don't send the additional space, or have some obscure ls -l output. Maybe we also have to finally split out the local "ls -lga" from the FTP ls parsing, which might allow us to remove some special extfs cases.
*** Bug 354263 has been marked as a duplicate of this bug. ***
Bug 350052, bug 359145, bug 361017 and bug 367521 describe incorrect behaviour or crashes relating to filenames, directories or symlinks starting with a year. Bug 359145 and bug 367521 have extensive analysis and bug 359145 also contains a patch. Can we make sure these are not caused by the same issue and have the patch looked at?
The nautilus parses the output given by the ftp-server. There is always an extra space that is prefixed to the year of the file creation, if at all it is displayed. Let's consider the following scenario: -rw-r--r-- 1 nobody nobody 3903 May 11 12:58 2006 tmpfile [ in this case file name is "2006 tmpfile" ] In order to fix this issue, a check is made to see if there is an extra space before "2006". If there is one,it is considered as a year of the file creation, if not, it is considered as part of the file name itself. In the above case, there is no extra space prefixed to "2006". Hence "2006" is considered as part of the filename. Will attach a patch soon.
Created attachment 85115 [details] [review] Patch to fix the bug
The given patch will not parse the file/folder named like " 2006 tmpfile"(ie: Prefixed with single space only). In this case " 2006" is considered as a year as per the logic mentioned in the previous comments.
Could someone kindly review the patch.
could you send it on the gnome-vfs mailing list? the maintainers don't read bugzilla often
Commited.