Bug 18619

Summary: ftp cmds.c thinks gateport is a short, it's a char *.
Product: Base System Reporter: dwmalone <dwmalone>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description dwmalone 2000-05-17 10:20:00 UTC
On 2000/01/27 IPv6 changes were made to ftp, which changed gateport
from a network bite order short to a char *, for use with getaddrinfo.
Unfortunately cmds.c seems to have been missed in this merge, resulting
in some confused code.

Fix: The following patch seems to work, but I'm sure the IPv6 people have
a working version in their own tree.
How-To-Repeat: 
If you try to set the gate port and then ftp this will cause a core dump:

% ftp
ftp> gate localhost 1
Gate ftp: on, server localhost, port 1.
ftp> open localhost
Segmentation fault (core dumped)

Compiling ftp also gives warnings:

cc -O -pipe -DINET6 -g   -c /usr/src/usr.bin/ftp/cmds.c
/usr/src/usr.bin/ftp/cmds.c: In function `status':
/usr/src/usr.bin/ftp/cmds.c:661: warning: initialization makes integer from poin
ter without a cast
/usr/src/usr.bin/ftp/cmds.c: In function `setgate':
/usr/src/usr.bin/ftp/cmds.c:892: warning: assignment makes pointer from integer 
without a cast
/usr/src/usr.bin/ftp/cmds.c:906: warning: initialization makes integer from poin
ter without a cast
Comment 1 ru freebsd_committer freebsd_triage 2000-06-24 16:36:20 UTC
State Changed
From-To: open->closed

Fixed, thanks!