Subject: bin/15943: ftp assumes local file are `files'
To: None <gnats-bugs@gnats.netbsd.org>
From: None <lha@stacken.kth.se>
List: netbsd-bugs
Date: 03/17/2002 13:28:48
>Number: 15943
>Category: bin
>Synopsis: ftp assumes local file are `files'
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 17 04:31:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Love
>Release: NetBSD 1.5ZB
>Organization:
Stacken Computer Club
>Environment:
System: NetBSD nutcracker.stacken.kth.se 1.5ZB NetBSD 1.5ZB (NUTCRACKER) #3: Sun Mar 10 10:43:00 CET 2002 lha@nutcracker.stacken.kth.se:/usr/src/sys/arch/i386/compile/NUTCRACKER i386
Architecture: i386
Machine: i386
>Description:
ftp assumes local files are `files' and write always write(2)
all bytes.
>How-To-Repeat:
cat > foo.c <<EOF
int
main(int argc, char **argv)
{
return select(0,0,0,0,0);
}
EOF
gcc -o foo foo.c
largefile=ftp://ftp.netbsd.org/pub/NetBSD/iso/1.5/i386cd.iso
ftp -o - $largefile | ./foo
wait until data starts to flow and press ^T to get statistics
: lha@nutcracker ; cat > foo.c <<EOF
> int
> main(int argc, char **argv)
> {
> return select(0,0,0,0,0);
> }
> EOF
: lha@nutcracker ; gcc -o foo foo.c
: lha@nutcracker ; largefile=ftp://ftp.netbsd.org/pub/NetBSD/iso/1.5/i386cd.iso
: lha@nutcracker ; ftp -o - $largefile | ./foo
Trying 3ffe:8050:201:1860:2a0:c9ff:feed:b7ea...
load: 0.30 cmd: ftp 3551 [runnable] 0.00u 0.01s 0% 872k
load: 0.33 cmd: ftp 3551 [runnable] 0.00u 0.02s 0% 876k
17376 bytes received in 00:08 (2.05 KB/s) ETA: 12:56:47 (stalled)
ftp: -: short write
load: 0.28 cmd: foo 3552 [select] 0.00u 0.00s 0% 276k
load: 0.28 cmd: foo 3552 [select] 0.00u 0.00s 0% 276k
>Fix:
use equivalent of net_write/net_read in libroken
>Release-Note:
>Audit-Trail:
>Unformatted: