Subject: pkg/17791: pkg_add not able to work behind a firewall with only http_proxy gateway
To: None <gnats-bugs@gnats.netbsd.org>
From: None <root@ip.cdn.telstra.com.au>
List: netbsd-bugs
Date: 07/31/2002 17:54:58
>Number:         17791
>Category:       pkg
>Synopsis:       pkg_add not able to work behind a firewall with only http_proxy gateway
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 31 23:18:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Marc Boschma
>Release:        NetBSD 1.6_BETA4 (20020728)
>Organization:
Telstra
>Environment:
System: NetBSD troy 1.6_BETA4 NetBSD 1.6_BETA4 (GENERIC) #0: Sun Jul 28 18:17:59 UTC 2002 autobuild@tgm.daemon.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386

troy# pkg_add -V
20020723

>Description:
pkg_add is not able to retrive the packages when behind a http proxy,
even though ftp can.

It seems to be in the way pkg_add interacts with the ftp client. Since
utilising the ftp client in an interactive mode the ftp_proxy and http_proxy
support does not work.

pkg_add should be changed to utilise ftp in batch mode. Possibly, if needed,
the ftp client should be augmented to return status codes that would be usefull
for pkg_add.

>How-To-Repeat:
The user and password in the proxy environment have been changed.

The following sequence:

troy# env
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin:/usr/X11R6/bin:/us
r/local/sbin:/usr/local/bin
TERM=vt100
USER=root
HOME=/root
SHELL=/bin/csh
SU_FROM=marc
PWD=/root
BLOCKSIZE=1k
http_proxy=http://user:pw@http-gw.telecom.com.au:80/
ftp_proxy=http://user:pw@http-gw.telecom.com.au:80/
PKG_PATH=ftp://ftp.netbsd.org/pub/NetBSD/packages/1.6/i386/All

troy# pkg_add -v priv
parsing: ftp://ftp.netbsd.org/pub/NetBSD/packages/1.6/i386/All
path: ftp://ftp.netbsd.org/pub/NetBSD/packages/1.6/i386/All
trying PKG_PATH ftp://ftp.netbsd.org/pub/NetBSD/packages/1.6/i386/All
Spawning FTP coprocess
ftp -detv ftp://ftp.netbsd.org/pub/NetBSD/packages/1.6/i386/All/
ftp: No address associated with hostname
ftp: Can't connect or login to host `ftp.netbsd.org'
^CSignal 2 received, cleaning up.
troy#

>Fix:

Other than changing pkg_add to use the ftp client in a non-interactive
mode, the only other option is to explicitly download the packages and
install them. The problem is that the package dependences are not always
that clear until you try to install, and it's a manual process.

Since you can install the OS via the http proxy, and I did for this
system, being able to add packages should also work.

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