From owner-freebsd-bugs Fri Mar 2 8:40:11 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 24C6F37B718 for ; Fri, 2 Mar 2001 08:40:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f22Ge1366883; Fri, 2 Mar 2001 08:40:01 -0800 (PST) (envelope-from gnats) Received: from SMTP.Network-Alchemy.COM (Hydrogen.Network-Alchemy.COM [199.46.17.130]) by hub.freebsd.org (Postfix) with SMTP id 8886F37B71B for ; Fri, 2 Mar 2001 08:34:22 -0800 (PST) (envelope-from mike@pelley.americas.nokia.com) Received: from pelley.americas.nokia.com ([172.18.72.127]) by Hydrogen.Network-Alchemy.COM via INTERNET ; Fri, 2 Mar 2001 08:33:36 PST Received: (from mike@localhost) by pelley.americas.nokia.com (8.11.2/8.11.1) id f22GWVh00622; Fri, 2 Mar 2001 11:32:31 -0500 (EST) (envelope-from mike) Message-Id: <200103021632.f22GWVh00622@pelley.americas.nokia.com> Date: Fri, 2 Mar 2001 11:32:31 -0500 (EST) From: mike@pelley.com Reply-To: mike@pelley.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/25494: fetch uses environment variable FTP_PROXY, ftp/lynx use ftp_proxy Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25494 >Category: bin >Synopsis: fetch uses environment variable FTP_PROXY, ftp/lynx use ftp_proxy >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Mar 02 08:40:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Mike Pelley >Release: FreeBSD 4.2-STABLE i386 >Organization: Foundation >Environment: >Description: Environment variables used to support proxies should be consistent across applications. ftp and lynx support ftp_proxy - fetch should do the same. This also affects HTTP_PROXY/http_proxy. >How-To-Repeat: man 3 fetch - compare to man ftp. >Fix: Change fetch to support lowercase ftp_proxy/http_proxy as well, and change man page to only mention the lowercase versions. I also think it's worth duplicating the environment variables from fetch(3) on fetch(1), but I have not done that. Following changes are against STABLE: Index: ftp.c =================================================================== RCS file: /home/ncvs/src/lib/libfetch/ftp.c,v retrieving revision 1.16.2.18 diff -u -r1.16.2.18 ftp.c --- ftp.c 2001/02/22 16:23:52 1.16.2.18 +++ ftp.c 2001/03/01 23:23:05 @@ -875,10 +875,11 @@ struct url *purl; char *p; - if (((p = getenv("FTP_PROXY")) || (p = getenv("HTTP_PROXY"))) && + if (((p = getenv("FTP_PROXY")) || (p = getenv("ftp_proxy")) || + (p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) && *p && (purl = fetchParseURL(p)) != NULL) { if (!*purl->scheme) { - if (getenv("FTP_PROXY")) + if (getenv("FTP_PROXY") || getenv("ftp_proxy")) strcpy(purl->scheme, SCHEME_FTP); else strcpy(purl->scheme, SCHEME_HTTP); Index: http.c =================================================================== RCS file: /home/ncvs/src/lib/libfetch/http.c,v retrieving revision 1.13.2.12 diff -u -r1.13.2.12 http.c --- http.c 2000/11/10 10:40:58 1.13.2.12 +++ http.c 2001/03/01 23:23:05 @@ -651,7 +651,8 @@ struct url *purl; char *p; - if ((p = getenv("HTTP_PROXY")) && (purl = fetchParseURL(p))) { + if (((p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) && + (purl = fetchParseURL(p))) { if (!*purl->scheme) strcpy(purl->scheme, SCHEME_HTTP); if (!purl->port) Index: fetch.3 =================================================================== RCS file: /home/ncvs/src/lib/libfetch/fetch.3,v retrieving revision 1.11.2.14 diff -u -r1.11.2.14 fetch.3 --- fetch.3 2001/02/22 16:24:24 1.11.2.14 +++ fetch.3 2001/03/01 23:23:05 @@ -430,7 +430,7 @@ .It Ev FTP_PASSWORD Default FTP password if the remote server requests one and none was provided in the URL. -.It Ev FTP_PROXY +.It Ev ftp_proxy URL of the proxy to use for FTP requests. The document part is ignored. FTP and HTTP proxies are supported; if no scheme is specified, FTP is @@ -447,7 +447,7 @@ .Pp If this variable is set to an empty string, no proxy will be used for FTP requests, even if the -.Ev HTTP_PROXY +.Ev http_proxy variable is set. .It Ev HTTP_AUTH Specifies HTTP authorization parameters as a colon-separated list of @@ -461,14 +461,14 @@ .Pp This variable is only used if the server requires authorization and no user name or password was specified in the URL. -.It Ev HTTP_PROXY +.It Ev http_proxy URL of the proxy to use for HTTP requests. The document part is ignored. Only HTTP proxies are supported for HTTP requests. If no port number is specified, the default is 3128. .Pp Note that this proxy will also be used for FTP documents, unless the -.Ev FTP_PROXY +.Ev ftp_proxy variable is set. .It Ev HTTP_PROXY_AUTH Specifies authorization parameters for the HTTP proxy in the same @@ -553,9 +553,9 @@ and FTP proxy support. .Pp There's no way to select a proxy at run-time other than setting the -.Ev HTTP_PROXY +.Ev http_proxy or -.Ev FTP_PROXY +.Ev ftp_proxy environment variables as appropriate. .Pp .Nm libfetch >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message