| Summary: | ftpd bug | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Yoshihiro Koya <Yoshihiro.Koya> | ||||
| Component: | bin | Assignee: | Dag-Erling Smørgrav <des> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 5.0-CURRENT | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Yoshihiro Koya
2001-03-11 12:20:01 UTC
Yoshihiro Koya <Yoshihiro.Koya@math.yokohama-cu.ac.jp> writes: > >Fix: > --- /usr/src/libexec/ftpd/ftpd.c.orig Sun Mar 11 20:19:53 2001 > +++ /usr/src/libexec/ftpd/ftpd.c Sun Mar 11 20:46:15 2001 > @@ -1756,10 +1756,12 @@ > if (!cnt) > goto oldway; > > + byte_count = offset; > goto data_err; > } > } > > + byte_count = offset; > reply(226, "Transfer complete."); > return; > } Wrong patch. You set byte_count to offset, so if the transfer was restarted in mid-file you also count bytes that *weren't* transferred. The correct fix is: Index: ftpd.c =================================================================== RCS file: /home/ncvs/src/libexec/ftpd/ftpd.c,v retrieving revision 1.72 diff -u -r1.72 ftpd.c --- ftpd.c 2000/12/20 03:34:54 1.72 +++ ftpd.c 2001/03/11 13:16:57 @@ -1749,6 +1749,7 @@ while (err != -1 && cnt < filesize) { err = sendfile(filefd, netfd, offset, len, (struct sf_hdtr *) NULL, &cnt, 0); + byte_count += cnt; offset += cnt; len -= cnt; (apply with 'patch -l' due to cut&paste corruption) DES -- Dag-Erling Smorgrav - des@ofug.org Responsible Changed From-To: freebsd-bugs->des Better patch submitted by des. Perhaps he should commit it (if this didn't already happen)? State Changed From-To: open->closed Fixed & MFCed before 4.3-RELEASE. |