Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 1999 19:09:42 -0500 (EST)
From:      John.Shue@symmetron.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/9464: Fix for fetch ignoring FTP_PASSIVE_MODE environment variable
Message-ID:  <199901130009.TAA02806@www2.symmetron.com>

next in thread | raw e-mail | index | archive | help

>Number:         9464
>Category:       bin
>Synopsis:       Fix for fetch ignoring FTP_PASSIVE_MODE environment variable
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 12 16:20:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     John A. Shue
>Release:        FreeBSD 2.2.8-STABLE i386
>Organization:
Symmetron, Inc.
>Environment:

	FTP_PASSIVE_MODE=YES

>Description:

	fetch man page states that the environment variable FTP_PASSIVE_MODE
	is used to "force the use of passive mode FTP".  This feature is not
	working as advertised.  I know that a quick fix is to just use the
	-p command-line option (which does work), but fetch should be fixed

>How-To-Repeat:

	(shell: csh and current machine behind strict firewall)
	% setenv FTP_PASSIVE_MODE
	% fetch "ftp://ftp.freebsd.org/pub/FreeBSD/README"
	(after time-out period)
	error: fetch: Can't open data connection
	% setenv FTP_PASSIVE_MODE YES
	% fetch "ftp://ftp.freebsd.org/pub/FreeBSD/README"
	(after time-out period)
	error: fetch: Can't open data connection

>Fix:
	
	The following context patch fixes the FTP_PASSIVE_MODE bug and
	works on $Id: ftp.c,v 1.3.2.6 1998/09/23 12:23:29 jkh Exp $ from
	my 2.2.8-stable and
	$Id: ftp.c,v 1.11 1998/12/08 13:00:49 cracauer Exp $ from
	3.0-current.

*** ftp.c.orig	Tue Jan 12 17:50:41 1999
--- ftp.c	Tue Jan 12 17:52:36 1999
***************
*** 366,371 ****
--- 366,373 ----
  		}
  	} else
  		ftpBinary(ftp);
+ 	if(getenv("FTP_PASSIVE_MODE"))
+ 	  fs->fs_passive_mode=1;
  	ftpPassive(ftp, fs->fs_passive_mode);
  	for (i = 0, dp = ftps->ftp_remote_dirs; i < ftps->ftp_remote_ndirs; i++, dp++) {
  		if ((status = ftpChdir(ftp, *dp)) != 0) {

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901130009.TAA02806>