From archie@whistle.com  Thu Apr  9 20:00:32 1998
Received: from whistle.com (s205m131.whistle.com [207.76.205.131])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA11203
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 9 Apr 1998 20:00:26 -0700 (PDT)
          (envelope-from archie@whistle.com)
Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id TAA04344 for <FreeBSD-gnats-submit@freebsd.org>; Thu, 9 Apr 1998 19:59:51 -0700 (PDT)
Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3)
	id sma004342; Thu Apr  9 19:59:25 1998
Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id TAA03296; Thu, 9 Apr 1998 19:59:25 -0700 (PDT)
Message-Id: <199804100259.TAA03296@bubba.whistle.com>
Date: Thu, 9 Apr 1998 19:59:25 -0700 (PDT)
From: Archie Cobbs <archie@whistle.com>
Reply-To: archie@whistle.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: ftpPassive() function in libftpio(3) is broken
X-Send-Pr-Version: 3.2

>Number:         6259
>Category:       bin
>Synopsis:       ftpPassive() function in libftpio(3) is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr  9 20:10:01 PDT 1998
>Closed-Date:    Sat Apr 11 00:28:58 PDT 1998
>Last-Modified:  Sat Apr 11 00:29:11 PDT 1998
>Originator:     Archie Cobbs
>Release:        FreeBSD 2.2.6-BETA i386
>Organization:
Whistle Communications, Inc.
>Environment:

	FreeBSD 2.2-stable

>Description:

	The ftpPassive() function returns successful even
	if the remote ftp server does not support passive mode.
	The ftpPassive() function does not look for the right
	return code after the PASV command.

>How-To-Repeat:

	Call ftpPassive() function while connected to an
	ftp server that doesn't support passive mode.
	Notice return value is successful.

>Fix:

1. cd /usr/src/lib/libftpio
2. Apply patch:
	
Index: ftpio.c
===================================================================
RCS file: /cvs/freebsd/src/lib/libftpio/ftpio.c,v
retrieving revision 1.15.2.5
diff -c -r1.15.2.5 ftpio.c
*** ftpio.c	1998/02/17 20:04:33	1.15.2.5
--- ftpio.c	1998/04/10 02:56:04
***************
*** 324,331 ****
      if (ftp->is_passive == st)
  	return SUCCESS;
      i = cmd(ftp, "PASV");
!     if (i < 0)
!         return i;
      ftp->is_passive = !ftp->is_passive;
      return SUCCESS;
  }
--- 324,331 ----
      if (ftp->is_passive == st)
  	return SUCCESS;
      i = cmd(ftp, "PASV");
!     if (i != FTP_PASSIVE_HAPPY)
!         return FAILURE;
      ftp->is_passive = !ftp->is_passive;
      return SUCCESS;
  }

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sat Apr 11 00:28:58 PDT 1998 
State-Changed-Why:  
fixed. 
>Unformatted:
