From owner-freebsd-bugs@FreeBSD.ORG Sun Aug 21 13:50:01 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B95916A41F for ; Sun, 21 Aug 2005 13:50:01 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 222F143D49 for ; Sun, 21 Aug 2005 13:50:01 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j7LDo0Y9082878 for ; Sun, 21 Aug 2005 13:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j7LDo0Rj082877; Sun, 21 Aug 2005 13:50:00 GMT (envelope-from gnats) Resent-Date: Sun, 21 Aug 2005 13:50:00 GMT Resent-Message-Id: <200508211350.j7LDo0Rj082877@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Conall O'Brien" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3156E16A41F; Sun, 21 Aug 2005 13:40:41 +0000 (GMT) (envelope-from conallob@maths.tcd.ie) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 358CB43D45; Sun, 21 Aug 2005 13:40:39 +0000 (GMT) (envelope-from conallob@maths.tcd.ie) Received: from walton.maths.tcd.ie ([134.226.81.10] helo=walton.maths.tcd.ie) by salmon.maths.tcd.ie with SMTP id ; 21 Aug 2005 14:40:38 +0100 (BST) Message-Id: <200508211440.aa07330@walton.maths.tcd.ie> Date: Sun, 21 Aug 2005 14:40:38 +0100 (BST) From: "Conall O'Brien" Sender: conallob@maths.tcd.ie To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: David Malone , Ian Dowse Subject: misc/85185: Env Parser problem in libfetch X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Conall O'Brien List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Aug 2005 13:50:01 -0000 >Number: 85185 >Category: misc >Synopsis: Env Parser problem in libfetch >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Aug 21 13:50:00 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Conall O'Brien >Release: FreeBSD 4.11-STABLE i386 >Organization: >Environment: System: FreeBSD walton.maths.tcd.ie 4.11-STABLE FreeBSD 4.11-STABLE #25: Mon May 9 11:36:51 BST 2005 conallob@gosset.maths.tcd.ie:/mnt/obj/usr/src/sys/WALTON i386 FreeBSD sweetums.infocad.ie 5.4-STABLE FreeBSD 5.4-STABLE #4: Fri Aug 5 15:29:22 IST 2005 conall@sweetums.infocad.ie:/usr/src/obj/usr/src/sys/SWEETUMS alpha >Description: fetch misunderstands envirometal variables http_proxy and HTTP_PROXY, if set to "" As a result, fetch assumes the proxy host is "" and the proxy port is 3124 and fails every time An example: fetch -vv http://www.google.com scheme: [http] user: [] password: [] host: [www.google.com] port: [0] document: [/] scheme: [] user: [] password: [] host: [] port: [0] document: [/] ---> :3128 looking up fetch: http://www.google.com: Host not found >How-To-Repeat: Behaviour has been reproduced on RELENG_4 and RELENG_5. Set HTTP_PROXY or http_proxy to working proxy config, or unset variables accordingly and fetch works as expected. (setenv | export) HTTP_PROXY or http_proxy to "" and fetch fails. >Fix: Use the same parser checks from src/lib/libfetch/ftp.c in src/lib/libfetch/http.c --- http.c.orig Sun Aug 21 14:19:26 2005 +++ http.c Sun Aug 21 14:22:26 2005 @@ -717,7 +717,7 @@ if (flags != NULL && strchr(flags, 'd') != NULL) return (NULL); if (((p = getenv("HTTP_PROXY")) || (p = getenv("http_proxy"))) && - (purl = fetchParseURL(p))) { + *p && (purl = fetchParseURL(p)) =! NULL) { if (!*purl->scheme) strcpy(purl->scheme, SCHEME_HTTP); if (!purl->port) >Release-Note: >Audit-Trail: >Unformatted: