Closed Bug 484684 Opened 16 years ago Closed 16 years ago

ParseFTPList can't handle regular unix ls -l listing of filenames starting with spaces.

Categories

(Core Graveyard :: Networking: FTP, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.2b1

People

(Reporter: andreas+mozilla, Assigned: michal)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) Gecko/2009030810 Iceweasel/3.0.7 (Debian-3.0.7-1) Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) Gecko/2009030810 Iceweasel/3.0.7 (Debian-3.0.7-1) ParseFTPList strips of all leading spaces..... a filename that starts with spaces gets incorrectly listed. ie. if you have both ' foo' and 'foo', you get a directory listing with 2x'foo'. Reproducible: Always Steps to Reproduce: 1. create files 'foo' and ' foo' on your ftp server. 2. connect with firefox 3. see 'foo' listed twice. Actual Results: 'foo' listed twice. Expected Results: ' foo' and 'foo' listed. Originally reported here (gvfsd-ftp reuses ParseFTPList): http://bugzilla.gnome.org/show_bug.cgi?id=576229 See line 107 and 1165: http://hg.mozilla.org/mozilla-central/file/956071116564/netwerk/streamconv/converters/ParseFTPList.cpp#l107 http://hg.mozilla.org/mozilla-central/file/956071116564/netwerk/streamconv/converters/ParseFTPList.cpp#l1165
Attached patch workaround (obsolete) — Splinter Review
This patch fixes the regular unix ls -l case, but might break the Hellsoft (old version) parsing which has an example at: http://hg.mozilla.org/mozilla-central/file/956071116564/netwerk/streamconv/converters/ParseFTPList.cpp#l977
Component: General → Networking: FTP
Product: Firefox → Core
QA Contact: general → networking.ftp
Andreas, you need to ask someone for review if you want to get the patch in.
(In reply to comment #2) > Andreas, you need to ask someone for review if you want to get the patch in. Who? Where? How? Do you have anyone you can poke about looking at this? As I said before, my patch is a tradeoff that probably breaks some old obscure list format that I've never seen used to fix the common unix list format.... Would be nice if you have anyone available who cares about ParseFTPList for discussing the issue.
Attachment #368798 - Flags: review?
This patch fixes space at the beginning of the filename for unix and DOS listing. It also contains a unittest. I'm not sure if old Hellsoft ftp really puts more spaces between date and filename. There is only 1 space in file netwerk/streamconv/converters/parse-ftp/U-HellSoft.in. But lets assume that some version with more spaces exists...
Attachment #368798 - Attachment is obsolete: true
Attachment #371958 - Flags: review?(doug.turner)
Attachment #368798 - Flags: review?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #371958 - Flags: superreview?(bzbarsky)
Attachment #371958 - Flags: review?(jduell.mcbugs)
Attachment #371958 - Flags: review?(doug.turner)
Attachment #371958 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 371958 [details] [diff] [review] patch [Checkin: Comment 7] Looks ok, but doesn't look like a change that needs sr to start with. Does look like a change where a diff -w would be good.
Comment on attachment 371958 [details] [diff] [review] patch [Checkin: Comment 7] This looks great. Nice test coverage.
Attachment #371958 - Flags: review?(jduell.mcbugs) → review+
Attachment #371958 - Attachment description: patch → patch [Checkin: Comment 7]
Attachment #371958 - Flags: approval1.9.1.3?
Assignee: nobody → michal.novotny
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2b1
Version: unspecified → Trunk
Comment on attachment 371958 [details] [diff] [review] patch [Checkin: Comment 7] This bug must have been around forever, we'd rather not take it on the stable branches and incur the additional QA requirement of testing the changed code.
Attachment #371958 - Flags: approval1.9.1.3? → approval1.9.1.3-
Depends on: 552034
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: