After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 350052 - FTP - incorrect handling of filenames starting with years
FTP - incorrect handling of filenames starting with years
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Module: ftp
2.15.x
Other All
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
: 354263 (view as bug list)
Depends on:
Blocks: 359145
 
 
Reported: 2006-08-05 11:37 UTC by Robert Spanjaard
Modified: 2007-03-30 07:53 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Patch to fix the bug (2.22 KB, patch)
2007-03-22 14:11 UTC, Manjunath K V
none Details | Review

Description Robert Spanjaard 2006-08-05 11:37:15 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:
Comment 1 Christian Neumair 2006-08-05 13:04:09 UTC
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.
Comment 2 Pascal Terjan 2006-10-02 22:19:08 UTC
*** Bug 354263 has been marked as a duplicate of this bug. ***
Comment 3 Teppo Turtiainen 2007-02-02 11:09:37 UTC
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?
Comment 4 Manjunath K V 2007-03-22 14:10:16 UTC
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.
Comment 5 Manjunath K V 2007-03-22 14:11:37 UTC
Created attachment 85115 [details] [review]
Patch to fix the bug
Comment 6 Manjunath K V 2007-03-23 09:40:13 UTC
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. 
Comment 7 Manjunath K V 2007-03-26 10:04:26 UTC
Could someone kindly review the patch.
Comment 8 Sebastien Bacher 2007-03-26 10:38:38 UTC
could you send it on the gnome-vfs mailing list? the maintainers don't read bugzilla often
Comment 9 Alexander Larsson 2007-03-30 07:53:06 UTC
Commited.