Bug 19390

Summary: non connect virtual hosting support in ftpd daemon
Product: Base System Reporter: isv <isv>
Component: binAssignee: davidn
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description isv 2000-06-20 01:20:00 UTC
FreeBSD ftp daemon have bugs in "selecthost" function,
that causes not correct virtual hosting support.
I have detected that in FreeBSD release 4.0.

 selecthost(su)
        union sockunion *su;                                                     
 {                                                                               
...
       while (hrp != NULL) {
                for (hi = hrp->hostinfo; hi != NULL; hi = hi->ai_next)
              {                                                                  
               if (memcmp(su, hi->ai_addr, hi->ai_addrlen) == 0) {

How-To-Repeat: Add any vistual host to /etc/ftphosts with necessary rules, described in
man ftpd. and try login to this host as anonymous user. You will be wonder, because we will enter to base host ;)
Comment 1 Akinori MUSHA freebsd_committer freebsd_triage 2000-06-22 12:09:11 UTC
Responsible Changed
From-To: freebsd-ports->freebsd-bugs

Misfiled PR.
Comment 2 davidn freebsd_committer freebsd_triage 2000-06-23 21:35:47 UTC
Responsible Changed
From-To: freebsd-bugs->davidn

I first implemented this, so my bug
Comment 3 davidn freebsd_committer freebsd_triage 2000-06-23 21:49:40 UTC
State Changed
From-To: open->feedback

Originator asked to produce an example of this failing. 
Patch supplied does not appear to be applicable.
Comment 4 davidn freebsd_committer freebsd_triage 2000-06-26 21:36:50 UTC
State Changed
From-To: feedback->closed

Fixed by: 
/home/ncvs/src/libexec/ftpd/ftpd.c,v  <--  ftpd.c 
new revision: 1.64; previous revision: 1.63 
done 

This fix is different from the diff supplied with the PR. It fixes 
the real problem, which was in parsing /etc/ftphosts and folding lines.