From owner-freebsd-bugs Mon Apr 20 21:30:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA20935 for freebsd-bugs-outgoing; Mon, 20 Apr 1998 21:30:05 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA20911; Mon, 20 Apr 1998 21:30:02 -0700 (PDT) (envelope-from gnats) Received: from ymris.ddm.on.ca (p12a.neon.sentex.ca [207.245.212.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA19853 for ; Tue, 21 Apr 1998 04:20:34 GMT (envelope-from dchapes@ddm.on.ca) Received: from squigy.ddm.on.ca (squigy.ddm.on.ca [209.47.139.138]) by ymris.ddm.on.ca (8.8.8/8.8.8) with ESMTP id AAA04136 for ; Tue, 21 Apr 1998 00:20:29 -0400 (EDT) (envelope-from dchapes@ymris.ddm.on.ca) Received: (from dchapes@localhost) by squigy.ddm.on.ca (8.8.8/8.8.7) id AAA08216; Tue, 21 Apr 1998 00:20:27 -0400 (EDT) Message-Id: <199804210420.AAA08216@squigy.ddm.on.ca> Date: Tue, 21 Apr 1998 00:20:27 -0400 (EDT) From: dchapes@ddm.on.ca Reply-To: dchapes@ddm.on.ca To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/6371: fetch(1) uses HTTP_PROXY for ftp requests when FTP_PROXY undefined Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 6371 >Category: bin >Synopsis: fetch(1) uses HTTP_PROXY for ftp requests when FTP_PROXY undefined >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Apr 20 21:30:01 PDT 1998 >Last-Modified: >Originator: Dave Chapeskie >Organization: DDM Consulting >Release: FreeBSD 2.2.5-STABLE i386 >Environment: FreeBSD-2.2.6 >Description: I have a local Squid cache which I want fetch(1) to use for HTTP requests but not for FTP requests (the cache has ftp access disabled). If I just set the HTTP_PROXY variable fetch(1) uses the proxy for both. I couldn't find an easy way to tell fetch(1) not to use the proxy without undefining HTTP_PROXY. >How-To-Repeat: % setenv HTTP_PROXY somewhere % unsetenv FTP_PROXY % fetch ftp://somehost/some/path fetch(1) will use the HTTP_PROXY for the ftp request. >Fix: The following three line change causes fetch(1) to not use any proxy if the FTP_PROXY env variable exists but is null. It might be better to use a special value like "NONE" or change the semantics of having HTTP_PROXY defined without FTP_PROXY defined but this is a simpler change that doesn't impact people who don't set FTP_PROXY yet want fetch(1) to use the HTTP_PROXY. With this patch: % setenv HTTP_PROXY somewhere % setenv FTP_PROXY % fetch ftp://somehost/some/path fetch(1) will NOT use any proxy for the ftp request. Index: ftp.c =================================================================== RCS file: /cvs/FreeBSD/src/usr.bin/fetch/ftp.c,v retrieving revision 1.3.2.5 diff -u -r1.3.2.5 ftp.c --- ftp.c 1997/10/08 18:44:07 1.3.2.5 +++ ftp.c 1997/12/11 20:51:49 @@ -250,6 +250,9 @@ struct ftp_state *ftps; hostname = getenv("FTP_PROXY"); + if (hostname[0]=='\0') + return ftp_parse(fs,uri); + port = strchr(hostname, ':'); if (port == 0) { portno = 21; >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message