Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 85526 - tiny problem in fmirror causes not being able to connect to some sites
Summary: tiny problem in fmirror causes not being able to connect to some sites
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Seemant Kulleen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-16 10:15 UTC by Alin Dobre (RETIRED)
Modified: 2005-04-06 13:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fmirror-crlf.patch (fmirror-crlf.patch,387 bytes, patch)
2005-03-16 10:15 UTC, Alin Dobre (RETIRED)
Details | Diff
fmirror-ebuild.patch (fmirror-ebuild.patch,747 bytes, patch)
2005-03-16 10:35 UTC, Alin Dobre (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alin Dobre (RETIRED) gentoo-dev 2005-03-16 10:15:18 UTC
seems that the project is quite dead (site is not working -- the project is not a valid one), but that would not be a serious problem, as the application works.
i have sent an email to the upstream developer and responded MAILER-DAEMON (unknown user account) -- so this line is dead, too.

well, now the problem. i discovered this when trying to mirror a site that had SurgeFTP (www.netwinsite.com) as their FTP server. tried with wget, too, and it did connect to the ftp server w/o any problem. i looked into fmirror's source and found out that it sends after each command, only LF, instead of CRLF (RFC 959 states that each command must end with CRLF). the problem is located in the cmd() function, the problematic line being:
l = fprintf(out_file, "%s\n", buffer);
and it must be
l = fprintf(out_file, "%s\r\n", buffer);
(the \r byte added). after patching fmirror, everything worked fine.

i guess that surgeftp isn't the only ftp server that espects strictly the crlf pair, but many of the ftp servers running on windows.
here's a patch (tiny little one :P) that solves the problem, exactly as specified previously. the patch was result of the following command:
diff -Nut fmirror.c fmirror.c.new  > fmirror-crlf.patch

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Alin Dobre (RETIRED) gentoo-dev 2005-03-16 10:15:57 UTC
Created attachment 53637 [details, diff]
fmirror-crlf.patch

here's the tiny patch...
Comment 2 Alin Dobre (RETIRED) gentoo-dev 2005-03-16 10:35:59 UTC
Created attachment 53639 [details, diff]
fmirror-ebuild.patch

here is the ebuild patch to the fmirror-0.8.4-r1 version, which solves this bug
(assumes that the patch is in the files/ directory, where it should belong, as
it is a very little patch).
Comment 3 Seemant Kulleen (RETIRED) gentoo-dev 2005-04-06 13:05:10 UTC
Alin, thanks for the patch