Subject: apt-proxy: malformed URI requests with http_proxy (extra /:
http://fqdn:80//dir)
Package: apt-proxy
Version: 1.9.32
Severity: normal

*** Please type your report below this line ***
When using apt-proxy behind a proxy, the external requests are
malformed.

Example config: client:(/etc/apt/source.list)
deb http://myprox:9999/marillat sid main
Server: (/etc/apt-proxy/apt-proxy-v2.conf)
[marillat]
backends = http://ftp.nerim.net/debian-marillat

The external requests done by apt-proxy look like
GET:http://ftp.nerim.net:80//debian-marillat/dists/sid/main/binary-i386/Packages.gz
Note the ":80//" part.
Regular debian servers are robust to this malformed URL as seen in logs:

2005/09/28 10:35 CEST [Uninitialized] [http_client]
GET:http://security.debian.org:80//debian-security/dists/stable/updates/main/binary-i386/Packages.gz
2005/09/28 10:35 CEST [Uninitialized] [http_client]
host:security.debian.org
2005/09/28 10:35 CEST [Uninitialized] [http_client]
if-modified-since:Mon, 22 Aug 2005 09:13:50 GMT
2005/09/28 10:35 CEST [FetcherHttp,client] [http_client] handleStatus
200 - OK

But other servers such the one of Marillat are not robust:

2005/09/28 12:47 CEST [Uninitialized] [http_client]
GET:http://ftp.nerim.net:80//debian-marillat/dists/sid/main/binary-i386/Packages.gz
2005/09/28 12:47 CEST [Uninitialized] [http_client] host:ftp.nerim.net
2005/09/28 12:47 CEST [FetcherHttp,client] [http_client] handleStatus
400 - Bad Request

I could solve the problem with the following patch:
/usr/lib/python2.3/site-packages/apt_proxy/apt_proxy.py:
--- apt_proxy.py.orig   2005-09-28 13:14:53.000000000 +0200
+++ apt_proxy.py        2005-09-28 13:15:05.000000000 +0200
@@ -626,7 +626,7 @@
         else:
             self.sendCommand(self.request.method, "http://";
                              + self.request.backendServer.host + ":" +
str(self.request.backendServer.port)
-                             + "/" + self.request.backendServer.path
+                             + self.request.backendServer.path
                              + "/" + self.request.backend_uri)

         self.sendHeader('host', self.request.backendServer.host)

Note that this is just a fix, I don't know if the extra "/" must be
removed here or in self.request.backendServer.path

Phil

-- System Information:
Debian Release: testing/unstable
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.4.22-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages apt-proxy depends on:
ii  adduser                       3.64       Add and remove users and groups
ii  bzip2                         1.0.2-7    high-quality block-sorting
file co
ii  debconf [debconf-2.0]         1.4.52     Debian configuration
management sy
ii  logrotate                     3.7-5      Log rotation utility
ii  python                        2.3.5-2    An interactive high-level
object-o
ii  python-apt                    0.5.10     Python interface to libapt-pkg
ii  python-bsddb3                 3.3.0-6    Python interface to libdb3
ii  python-twisted                1.3.0-8    Event-based framework for
internet
ii  python2.3                     2.3.5-4    An interactive high-level
object-o

apt-proxy recommends no packages.

-- debconf information excluded




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to