Subject: bin/824: ftp core dumps on some .netrc constructions
To: None <gnats-admin@NetBSD.ORG>
From: None <jarle@idt.unit.no>
List: netbsd-bugs
Date: 02/24/1995 09:05:22
>Number:         824
>Category:       bin
>Synopsis:       ftp core dumps on some .netrc constructions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 24 09:05:13 1995
>Originator:     Jarle Greipsland
>Organization:
IDT (Institute for Dead Trees)
"	"
>Release:        1.0
>Environment:
	
System: NetBSD darling.idt.unit.no 1.0 NetBSD 1.0 (DARLING) #9: Wed Feb 15 21:11:36 MET 1995 root@darling.idt.unit.no:/usr/src/sys/arch/i386/compile/DARLING i386

>Description:
	If a init macro definition in .netrc ends with a line containing a
single space ftp will core dump.  As far as I can see this has to do with
how ftp parse and execute macros.  I started looking at the code, but I
think I'll defer that pleasure to the person who wrote it .....

I'm aware that the above mentioned single space construction is not a legal
one, and that something omnious probably should happen, but I don't think a
core dump is the right thing.

>How-To-Repeat:
Put the following segment into your .netrc file:
================================================================
machine ftp.leo.org login ftp password root@netbsd.org macdef init
cd pub
bin
prompt
pwd
 

================================================================
Note that the line following pwd contains a single blank, and that the next
line is empty.

Then do a 'ftp ftp.leo.org' and watch ftp work its way throug the init
macro and core dump with a segmentations fault.
	
>Fix:
	
Fix the .netrc parse stuff in the ftp client program.

----
Q: Why does the condemned man get a last cigarette instead of one of those 
   through-the-skin stick-on nicotine thingies?
A: Don't patch the executable.
>Audit-Trail:
>Unformatted: